org.cdlib.xtf.util
Class AttribList

Object
  extended by AttribList

public class AttribList
extends Object

Maintains a list of key/value pairs. Can be easily iterated over or searched by key.


Field Summary
private  LinkedList list
          The list is stored as a linked list.
 
Constructor Summary
AttribList()
           
 
Method Summary
 void clear()
          Remove all key/value pairs from the list
 String get(String key)
          Retrieves the value associated with the given key, or null if not present.
 boolean isEmpty()
          Check if the list is empty
 Iterator iterator()
          Get an iterator on the list
 void put(String key, String value)
          Add a key/value pair to the list.
 int size()
          Return the number of key/value pairs in the list
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

list

private LinkedList list
The list is stored as a linked list. Not so fast to iterate, but fast to add/remove.

Constructor Detail

AttribList

public AttribList()
Method Detail

put

public void put(String key,
                String value)
Add a key/value pair to the list. Note: does not check for duplicates!

Parameters:
key - Key identifier
value - Value to associate with that key

get

public String get(String key)
Retrieves the value associated with the given key, or null if not present.


iterator

public Iterator iterator()
Get an iterator on the list


clear

public void clear()
Remove all key/value pairs from the list


isEmpty

public boolean isEmpty()
Check if the list is empty


size

public int size()
Return the number of key/value pairs in the list