- public class kllist
- extends java.lang.Object
Linked list. All entries in an instance of kllist must be instances of (descendants of) klentry.
The base class for most of
vqServer's internal lists.
- See Also:
- klentry
kllist()
- Creates an empty list.
kllist(vqis)
- Creates a new list and fills it with entries read from the
specified input stream.
add(klentry)
- Adds the specified entry to the end of the list.
add(klentry, klentry)
- Adds an entry to the list after the specified entry.
addData(String)
- Creates a new instance of klentry with the specified key and adds it to the
end of the list.
addData(String, klentry)
- Creates a new entry (a klentry) with the specified key and adds it to the
list after the specified entry.
count()
- Returns the number of entries in the list.
enumKeys()
- Returns an enumeration of the keys of the entries in the list.
first()
- Returns the first entry in the list or null if the list
is empty.
get(int)
- Returns the nth entry in the list or null if the
number of entries in the list is less than n.
get(String)
- Returns the first entry in the list whose key matches (case insensitive)
the specified string or null if no corresponding entry
is found.
kill()
- Calls the kill() method of each entry in the
list and removes all entries from the list.
last()
- Returns the last entry in the list or null if the list
is empty.
moveDown(klentry)
- Moves the specified entry downwards by one position.
moveTo(klentry, klentry)
- Moves an entry to another position in the list.
moveUp(klentry)
- Moves the specified entry upwards by one position.
read(vqis)
- Reads entries from the
specified input stream and appends them to the list.
remove(klentry)
- Removes the specified entry from the list.
save(String)
- Writes the list to the specified file in vqServer .cfg file format.
save(vqos)
- Writes the list to the output stream specified in vqServer .cfg file format.
kllist
public kllist()
Creates an empty list.
kllist
public kllist(vqis is)
Creates a new list and fills it with entries read from the
specified input stream. Can only read instances of klentry, not classes that are descendants of
klentry. The entries must be stored in vqServer
.cfg file format.
- Parameters:
is
- the input stream to read the entries from
read
public void read(vqis is) throws java.io.IOException
Reads entries from the
specified input stream and appends them to the list.
Can only read instances of klentry, not classes that are descendants of
klentry. The entries must be stored in vqServer
.cfg file format.
- Parameters:
is
- the input stream to read the entries from
kill
public void kill()
Calls the kill() method of each entry in the
list and removes all entries from the list.
add
public void add(klentry newEntry,
klentry prevEntry)
Adds an entry to the list after the specified entry.
Warning: does not check the list membership of either
parameter.
- Parameters:
newEntry
- the entry to add to the list
prevEntry
- the entry which will precede the new entry in the list
addData
public void addData(java.lang.String newKey,
klentry prevEntry)
Creates a new entry (a klentry) with the specified key and adds it to the
list after the specified entry.
Warning: does not check the list membership of prevEntry.
- Parameters:
newKey
- the key of the new entry
prevEntry
- the entry which will precede the new entry in the list
addData
public void addData(java.lang.String newKey)
Creates a new instance of klentry with the specified key and adds it to the
end of the list.
- Parameters:
newKey
- the key of the new entry
add
public void add(klentry newEntry)
Adds the specified entry to the end of the list.
Warning: does not check the list membership of the parameter.
- Parameters:
newEntry
- the entry to add to the list
remove
public void remove(klentry theEntry)
Removes the specified entry from the list.
Warning: does not check the list membership of the parameter.
- Parameters:
theEntry
- the entry to remove from the list
moveUp
public void moveUp(klentry theEntry)
Moves the specified entry upwards by one position.
Warning: does not check the list membership of the parameter.
- Parameters:
theEntry
- the entry to move
moveDown
public void moveDown(klentry theEntry)
Moves the specified entry downwards by one position.
Warning: does not check the list membership of the parameter.
- Parameters:
theEntry
- the entry to move
moveTo
public void moveTo(klentry theEntry,
klentry prevEntry)
Moves an entry to another position in the list.
Warning: does not check the list membership of either parameter.
- Parameters:
theEntry
- the entry to move
prevEntry
- the entry which will precede theEntry after the move
count
public int count()
Returns the number of entries in the list.
- Returns:
- the number of entries in the list
first
public klentry first()
Returns the first entry in the list or null if the list
is empty.
- Returns:
- the first entry in the list
last
public klentry last()
Returns the last entry in the list or null if the list
is empty.
- Returns:
- the last entry in the list
get
public klentry get(java.lang.String theKey)
Returns the first entry in the list whose key matches (case insensitive)
the specified string or null if no corresponding entry
is found.
- Parameters:
theKey
- the key of the entry to retrieve
- Returns:
- the first entry in the list whose key matches the parameter
get
public klentry get(int n)
Returns the nth entry in the list or null if the
number of entries in the list is less than n.
- Parameters:
n
- the index of the entry in the list to retrieve
- Returns:
- the nth entry in the list
enumKeys
public java.util.Enumeration enumKeys()
Returns an enumeration of the keys of the entries in the list.
- Returns:
- an enumeration of the keys of the entries in the list
- See Also:
- java.util.Enumeration
save
public void save(java.lang.String fname)
Writes the list to the specified file in vqServer .cfg file format.
Calls the save(vqos) method of each entry in the list. Warning:
the contents
of the file are overwritten.
- Parameters:
fname
- the name of the file to write the list to
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