|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldman.collection.AbstractCollection.AbstractLocator<E>
goldman.collection.ordered.digitized.Trie.Tracker
protected class Trie.Tracker
Field Summary |
---|
Fields inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
versionNumber |
Method Summary | |
---|---|
boolean |
advance()
Moves this tracker to the next element in the iteration order (or {\texttt AFT} if the tracker is currently at the last element). |
E |
get()
Returns the element associated with this locator. |
boolean |
hasNext()
|
boolean |
inCollection()
Returns true if and only if the locator is at an element of the collection. |
void |
remove()
Removes the tracked element, leaving the tracker logically between the elements in the iteration order that preceded and followed the one removed. |
boolean |
retreat()
Moves this tracker to the previous element in the iteration order (or FORE if the tracker is currently at the first element). |
protected TrieLeafNode<E> |
skipRemovedElements(TrieLeafNode<E> ptr)
Similar to the path compression performed by the union-find data structure (Section~\ref{sec:union-find}), this method performs the optimization of compressing the path of the redirect chain by updating all next pointers to refer directly to the returned element. |
Methods inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
checkValidity, ignoreConcurrentModifications, ignorePriorConcurrentModifications, next, updateVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean inCollection()
Locator
public E get()
Locator
inCollection
method can be
used to determine if a tracked element is currently in the collection.
If the locator is at FORE or AFT then
a NoSuchElementException
is thrown.
NoSuchElementException
- this tracker is not at an element in
the collection.protected TrieLeafNode<E> skipRemovedElements(TrieLeafNode<E> ptr)
ptr
- reference to a trie node that is no longer
in the collection
ptr
in
the iteration order. If there is no such element
AFT is returned.public boolean advance()
AtBoundaryException
- this tracker is already at AFT since there is
no place to advance.public boolean retreat()
AtBoundaryException
- this tracker is already at FORE since there is
no place to retreat.public boolean hasNext()
public void remove()
NoSuchElementException
- the tracker is at FORE or AFT
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |