public class AssocArray extends Object
Modifier and Type | Class and Description |
---|---|
class |
AssocArray.Pair |
class |
AssocArray.PairEnumeration |
Modifier and Type | Field and Description |
---|---|
protected Vector<Integer> |
keys |
protected 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(Object key)
Returns true if the array contains the value of a specific key.
|
Enumeration<FList> |
elements()
Get an enumeration of values.
|
Object |
get(Object key)
Returns a value from the array given its associative key.
|
AssocArray.PairEnumeration |
getPairs() |
boolean |
isEmpty()
Returns true if the array is empty.
|
Enumeration<Integer> |
keys()
Get an enumeration of keys.
|
Object |
put(Integer key,
FList value)
Adds a key:value association to the array.
|
Object |
remove(Object key)
Removes the first instance of key and its associated value.
|
int |
size()
Returns the number of keys in the associative array.
|
public Enumeration<FList> elements()
public Object get(Object key)
key
- - Key object associated with value to lookup.public boolean isEmpty()
public Enumeration<Integer> keys()
public Object put(Integer key, FList value) throws NullPointerException
key
- New associative key.value
- New value to associate with key.NullPointerException
- is thrown if value is null.public Object remove(Object key)
key
- the key to remove.public int size()
public void clear()
public boolean containsKey(Object key)
key
- Key to look for.public AssocArray.PairEnumeration getPairs()
Copyright © 2003, 2023, Oracle and/or its affiliates.