|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
K - the type of objects serving as keysV - the type of objects serving as valuespublic interface LookupTable<K,V>
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.
| Nested Class Summary | |
|---|---|
static interface |
LookupTable.Entry<K,V>
A class of objects returned by iteration over entries. |
| Method Summary | |
|---|---|
void |
add(K key,
V value)
Adds the specified entry to the table. |
boolean |
contains(K key)
Returns true if the table contains an entry for this key. |
boolean |
isEmpty()
Tests if the table is empty. |
java.util.Iterator<LookupTable.Entry<K,V>> |
iterator()
Returns an iteration over the entries in this lookup table. |
V |
lookup(K key)
Returns the value associated with the specified key. |
void |
remove(K key)
Removes the entry corresponding to the key. |
int |
size()
Returns the number of entries in the table. |
| Method Detail |
|---|
boolean isEmpty()
int size()
boolean contains(K key)
key - the key to be searched for
void add(K key,
V value)
key - the key of the entryvalue - the value of the entryvoid remove(K key)
key - the key of the entry to be removedV lookup(K key)
key - the key to be searched for
NoSuchElementException - if key is not presentjava.util.Iterator<LookupTable.Entry<K,V>> iterator()
iterator in interface java.lang.Iterable<LookupTable.Entry<K,V>>LookupTable.Entry
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||