|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
A simple interface for a lookup table. Enables objects to be stored and retrieved using keys. Any object can be used as a key and any object can be used as the corresponding value.
| Inner Class Summary | |
static interface |
LookupTable.Entry
A class of objects returned by iteration over entries. |
| Method Summary | |
void |
add(java.lang.Object key,
java.lang.Object value)
Adds the specified entry to the table. |
boolean |
contains(java.lang.Object key)
Returns true if the table contains an entry for this key. |
boolean |
isEmpty()
Tests if the table is empty. |
java.util.Iterator |
iterator()
Iterates over the table's entries. |
java.lang.Object |
lookup(java.lang.Object key)
Returns the value associated with the specified key. |
void |
remove(java.lang.Object key)
Removes the entry corresponding to the key. |
int |
size()
Returns the number of entries in the table. |
| Method Detail |
public boolean isEmpty()
public int size()
public boolean contains(java.lang.Object key)
key - the key to be searched for
public void add(java.lang.Object key,
java.lang.Object value)
key - the key of the entryvalue - the value of the entrypublic void remove(java.lang.Object key)
key - the key of the entry to be removedpublic java.lang.Object lookup(java.lang.Object key)
key - the key to be searched forNoSuchElementException - if key is not presentpublic java.util.Iterator iterator()
LookupTable.Entry
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||