vqServer API Class vq.utils.kvlist

java.lang.Object
    |
    +----vq.utils.kllist
            |
            +----vq.utils.kvlist
Contents
Package index
Package
API index

public class kvlist
extends kllist
Linked list whose entries are (descendants of) kventry. Represents a list of key:value pairs.

See Also:
kventry

Constructor Index

 o kvlist()
Creates an empty list.
 o kvlist(vqis)
Creates a new list and fills it with entries read from the specified input stream.

Method Index

 o addData(String, String)
Creates a new entry (a kventry) with the specified key and value and adds it to the end of the list.
 o 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.
 o getByValue(String)
Returns the first list entry with the specified value or null if no matching entry is found.
 o getKey(String)
Returns the first key associated with the specified value or null if no matching entry is found.
 o getValue(String)
Returns the first value associated with the specified key in the list or null if no matching entry is found.
 o save(vqos)
Writes the list to the output stream specified in vqServer .cfg file format.
 o 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.

Constructor Detail

 o kvlist
public kvlist()
          Creates an empty list.
 o 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

Method Detail

 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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


vqServer API version 1.9. vqServer and the vqServer API are copyright © Steve Shering and vqSoft 1997-2000. Last updated 15 May 2000.

Contents
Package index
Package
API index