public class AssocArray
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
AssocArray.Pair |
class |
AssocArray.PairEnumeration |
Modifier and Type | Field and Description |
---|---|
protected java.util.Vector<java.lang.Integer> |
keys |
protected java.util.Vector<FList> |
values |
Constructor and Description |
---|
AssocArray()
Constructs an Associative Array.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all keys and values from the array.
|
boolean |
containsKey(java.lang.Object key)
Returns true if the array contains the value of a specific key.
|
java.util.Enumeration<FList> |
elements()
Get an enumeration of values.
|
java.lang.Object |
get(java.lang.Object key)
Returns a value from the array given its associative key.
|
AssocArray.PairEnumeration |
getPairs() |
boolean |
isEmpty()
Returns true if the array is empty.
|
java.util.Enumeration<java.lang.Integer> |
keys()
Get an enumeration of keys.
|
java.lang.Object |
put(java.lang.Integer key,
FList value)
Adds a key:value association to the array.
|
java.lang.Object |
remove(java.lang.Object key)
Removes the first instance of key and its associated value.
|
int |
size()
Returns the number of keys in the associative array.
|
protected java.util.Vector<java.lang.Integer> keys
protected java.util.Vector<FList> values
public java.util.Enumeration<FList> elements()
public java.lang.Object get(java.lang.Object key)
key
- - Key object associated with value to lookup.public boolean isEmpty()
public java.util.Enumeration<java.lang.Integer> keys()
public java.lang.Object put(java.lang.Integer key, FList value) throws java.lang.NullPointerException
key
- New associative key.value
- New value to associate with key.java.lang.NullPointerException
- is thrown if value is null.public java.lang.Object remove(java.lang.Object key)
key
- the key to remove.public int size()
public void clear()
public boolean containsKey(java.lang.Object key)
key
- Key to look for.public AssocArray.PairEnumeration getPairs()