|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jdsl.core.ref.InOrderIterator
The inorder iterator tells what, for an inorder traversal of the tree, the first, last, next, prev elements are, and can output a whole traversal of the tree, including the leaves.
| Constructor Summary | |
InOrderIterator(InspectableBinaryTree tree)
Constructs a new InOrderIterator to iterate the given container |
|
| Method Summary | |
Position |
current()
Gets the current Position |
Position |
first()
The first position in the in-order traversal |
Position |
last()
The last position in the in-order traversal |
Position |
next()
Gets the next Position |
Position |
prev()
Returns the in-order-previous of the given locator, including the leafs Throws a BoundaryViolationException if c is the first node in inorder traversal |
void |
setCurrent(Position newCurrent)
Sets the Iterator's current Locator to newCurrent. |
Sequence |
traversal()
Generates the inorder traversal of the tree. |
| Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Constructor Detail |
public InOrderIterator(InspectableBinaryTree tree)
tree - | Method Detail |
public Position current()
Positionpublic void setCurrent(Position newCurrent)
newCurrent - the Iterator's new current Locator
public Position next()
throws BoundaryViolationException
Position
public Position prev()
throws BoundaryViolationException
public Position first()
public Position last()
public Sequence traversal()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||