|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--structure.AbstractIterator | +--structure.ChainedHashtableIterator
A traversal of all the elements as they appear in a chained hashtable.
No order is guaranteed. This iterator is not publically accessable
and is used to implement ChainedHashtable's key and value iterators.
This iteration returns objects that are instances of Association
.
Typical use:
ChainedHashtable h = new ChainedHashtable(); // ...hashtable gets built up... Iterator hi = newChainedHashtableIterator(h.data)
; while (hi.hasNext()
) { System.out.println(ai.next()
); }
Field Summary | |
protected List |
data
The list of values within the table. |
protected java.util.Iterator |
elements
The iterator over the elements of the list. |
Constructor Summary | |
ChainedHashtableIterator(List[] table)
Construct an iterator over a chained hashtable. |
Method Summary | |
java.lang.Object |
get()
Get current value of iterator. |
boolean |
hasNext()
Returns true iff there are unconsidered elements within the table. |
java.lang.Object |
next()
Returns current value and increments iterator. |
void |
reset()
Resets the iterator to point to the beginning of the chained table. |
Methods inherited from class structure.AbstractIterator |
hasMoreElements, nextElement, remove, value |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List data
protected java.util.Iterator elements
Constructor Detail |
public ChainedHashtableIterator(List[] table)
table
- The array of lists to be traversed.Method Detail |
public void reset()
reset
in class AbstractIterator
public boolean hasNext()
hasNext
in interface java.util.Iterator
hasNext
in class AbstractIterator
AbstractIterator.hasMoreElements()
public java.lang.Object next()
next
in interface java.util.Iterator
next
in class AbstractIterator
AbstractIterator.hasMoreElements()
,
AbstractIterator.value()
public java.lang.Object get()
get
in class AbstractIterator
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |