- public class kvlist
- extends kllist
Linked list whose entries are (descendants of) kventry.
Represents a list of key:value pairs.
- See Also:
- kventry
kvlist()
- Creates an empty list.
kvlist(vqis)
- Creates a new list and fills it with entries read from the specified
input stream.
addData(String, String)
- Creates a new entry (a kventry) with the specified key and value
and adds it to the
end of the list.
addData(String, String, klentry)
- Creates a new entry (a kventry) with the specified key and value
and adds it to the
list at the specified position.
getByValue(String)
- Returns the first list entry with the specified value
or null if no matching entry is found.
getKey(String)
- Returns the first key associated with the specified value
or null if no matching entry is found.
getValue(String)
- Returns the first value associated with the specified key in the list
or null if no matching entry is found.
save(vqos)
- Writes the list to the output stream specified in vqServer .cfg file format.
setValue(String, String)
- Sets the first value associated with the specified key in the list
or creates a new entry with the specified key and value if no
matching entry is found.
kvlist
public kvlist()
Creates an empty list.
kvlist
public kvlist(vqis is) throws java.io.IOException
Creates a new list and fills it with entries read from the specified
input stream. Can only read instances of kventry, not classes that are
descendants of
kventry. The entries must be stored in vqServer
.cfg file format.
- Parameters:
is
- the input stream to read the list from
addData
public void addData(java.lang.String newKey,
java.lang.String newValue,
klentry prevEntry)
Creates a new entry (a kventry) with the specified key and value
and adds it to the
list at the specified position.
Warning: does not check the list membership of prevEntry.
- Parameters:
newKey
- the key of the new entry
newValue
- the value of the new entry
prevEntry
- the entry which will precede the new entry in the list
addData
public void addData(java.lang.String newKey,
java.lang.String newValue)
Creates a new entry (a kventry) with the specified key and value
and adds it to the
end of the list.
- Parameters:
newKey
- the key of the new entry
newValue
- the value of the new entry
getValue
public java.lang.String getValue(java.lang.String theKey)
Returns the first value associated with the specified key in the list
or null if no matching entry is found.
- Parameters:
theKey
- the key to search for
- Returns:
- the first value associated with the specified key
setValue
public void setValue(java.lang.String theKey,
java.lang.String theValue)
Sets the first value associated with the specified key in the list
or creates a new entry with the specified key and value if no
matching entry is found.
- Parameters:
theKey
- the key to search for
theValue
- the value which will be associated with the specified key
getByValue
public kventry getByValue(java.lang.String theValue)
Returns the first list entry with the specified value
or null if no matching entry is found.
- Parameters:
theValue
- the value to search for
- Returns:
- the first entry with the specified value
getKey
public java.lang.String getKey(java.lang.String theValue)
Returns the first key associated with the specified value
or null if no matching entry is found.
- Parameters:
theValue
- the value to search for
- Returns:
- the first key associated with the specified value
save
public void save(vqos os) throws java.io.IOException
Writes the list to the output stream specified in vqServer .cfg file format.
Calls the save(vqos) method of each entry in the list.
- Parameters:
os
- the output stream to write the list to
- Overrides:
- save in class kllist