|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Table is a collection that supports random access of data by key. For this interface, the key-data association is determined when data is added. A client can
A client can
A client can also
Inner Class Summary | |
static interface |
Table.Entry
A Table.Entry is an entry in a table. |
Method Summary | |
void |
add(java.lang.Object k,
java.lang.Object dat)
tbl.add(k, dat) adds an entry with data dat and key k to tbl. |
void |
clear()
tbl.clear() removes all entries from tbl. |
java.lang.Object |
data(java.lang.Object k)
tbl.data(k) returns the data for key k in tbl. |
boolean |
isKey(java.lang.Object k)
tbl.isKey(k) returns true if there is an entry with key k in tbl. |
java.util.Iterator |
iterator()
tbl.iterator() returns an iterator for all of the entries in tbl. |
java.util.Iterator |
iterator(java.lang.Object kLo)
tbl.iterator(Object kLo) returns an iterator for the entries in tbl whose key is at least kLo. |
java.util.Iterator |
iterator(java.lang.Object kLo,
java.lang.Object kHi)
tbl.iterator(Object kLo, Object kHi) returns an iterator for the entries in tbl whose key is at least kLo and less than kHi. |
void |
remove(java.lang.Object k)
tbl.remove(k) removes the entry for key k from tbl. |
int |
size()
tbl.size() returns the number of entries in tbl. |
Method Detail |
public boolean isKey(java.lang.Object k)
public void add(java.lang.Object k, java.lang.Object dat)
Precondition: tbl.isKey(k) is false.
public java.lang.Object data(java.lang.Object k)
Precondition: tbl.isKey(k) is true.
public void remove(java.lang.Object k)
Precondition: tbl.isKey(k) is true.
public int size()
public void clear()
public java.util.Iterator iterator()
public java.util.Iterator iterator(java.lang.Object kLo)
public java.util.Iterator iterator(java.lang.Object kLo, java.lang.Object kHi)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |