|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nom.tam.util.HashedList.HashedListIterator
public class HashedList.HashedListIterator
This inner class defines an iterator over the hashed list. An iterator need not start at the beginning of the list.
This class can be used by external users to both add and delete elements from the list. It implements the standard Iterator interface but also provides methods to add keyed or unkeyed elements at the current location.
Users may move either direction in the list using the next and prev calls. Note that a call to prev followed by a call to next (or vice versa) will return the same element twice.
The class is implemented as an inner class so that it can easily access the state of the associated HashedList.
Method Summary | |
---|---|
void |
add(java.lang.Object ref)
Add an entry at the current location. |
void |
add(java.lang.Object key,
java.lang.Object ref)
Add a keyed entry at the current location. |
boolean |
hasNext()
Is there another element? |
boolean |
hasPrev()
Is there a previous element? |
java.lang.Object |
next()
Get the next entry. |
java.lang.Object |
prev()
Get the previous entry. |
void |
remove()
Remove the last retrieved entry. |
void |
setKey(java.lang.Object key)
Point the iterator to a particular keyed entry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean hasNext()
hasNext
in interface java.util.Iterator
public boolean hasPrev()
hasPrev
in interface Cursor
public java.lang.Object next() throws java.util.NoSuchElementException
next
in interface java.util.Iterator
java.util.NoSuchElementException
public java.lang.Object prev() throws java.util.NoSuchElementException
prev
in interface Cursor
java.util.NoSuchElementException
public void remove()
remove
in interface java.util.Iterator
public void add(java.lang.Object ref)
add
in interface Cursor
public void add(java.lang.Object key, java.lang.Object ref)
add
in interface Cursor
public void setKey(java.lang.Object key)
setKey
in interface Cursor
key
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |