goldman.collection.ordered
Class BTree.Marker

java.lang.Object
  extended by goldman.collection.AbstractCollection.AbstractLocator<E>
      extended by goldman.collection.ordered.BTree.Marker
All Implemented Interfaces:
Locator<E>, Cloneable, Iterator<E>
Enclosing class:
BTree<E>

protected class BTree.Marker
extends AbstractCollection.AbstractLocator<E>


Field Summary
 
Fields inherited from class goldman.collection.AbstractCollection.AbstractLocator
versionNumber
 
Method Summary
 boolean advance()
          Moves the tracker to the next element in the iteration order, or {\texttt AFT} if the last element is currently tracked.
 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()
           
 boolean retreat()
          Moves the tracker to the previous element in the iteration order, or FORE if the first element is currently tracked.
 
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

inCollection

public boolean inCollection()
Description copied from interface: Locator
Returns true if and only if the locator is at an element of the collection.

Returns:
true if and only if the tracked element is currently in the collection.

get

public E get()
Description copied from interface: Locator
Returns the element associated with this locator. When a tracker is used, the element associated with the locator might no longer be in the collection. If desired, the 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.

Returns:
the marked element
Throws:
NoSuchElementException - marker is not at an element in the collection.

advance

public boolean advance()
Moves the tracker to the next element in the iteration order, or {\texttt AFT} if the last element is currently tracked.

Returns:
true if and only if after the update, the tracker is at an element of the collection.
Throws:
AtBoundaryException - the tracker is at AFT since there is no place to advance.

retreat

public boolean retreat()
Moves the tracker to the previous element in the iteration order, or FORE if the first element is currently tracked.

Returns:
true if and only if after the update, the tracker is at an element of the collection.
Throws:
AtBoundaryException - the tracker is at FORE since then there is no place to retreat.

hasNext

public boolean hasNext()
Returns:
true if there is some element after the current locator position.

remove

public void remove()