de.grogra.graph.impl
public class TreeIterator extends ObjectList implements java.util.Iterator
Iterator class iterates over all nodes
of the subtree starting at a specified root node. The subtree is spanned
by edges of type Graph.BRANCH_EDGE or
Graph.SUCCESSOR_EDGE in forward direction.elements, size, useEquals| Constructor and Description |
|---|
TreeIterator()
Create a new iterator.
|
TreeIterator(Node root)
Creates a new iterator iterating over the subtree starting
at
root. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
java.lang.Object |
next() |
Node |
nextNode()
Returns the next node of this iterator.
|
void |
remove() |
void |
setRoot(Node root)
Configures this iterator to iterate over the subtree starting
at
root. |
add, add, addAll, addAll, addAll, addIfNotContained, addInOrder, addInOrder, arraycopy, clear, clear, clone, consume, contains, ensureCapacity, equals, evaluateObject, get, hashCode, indexOf, isEmpty, lastIndexOf, peek, pop, push, push, push, remove, remove, removeAt, set, setSize, size, toArray, toArray, trimToSize, valuesaddAll, iterator, listIterator, listIterator, removeRange, subListcontainsAll, removeAll, retainAll, toStringpublic TreeIterator()
setRoot(Node) before it is used.public TreeIterator(Node root)
root.root - the root node of the subtreepublic boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorpublic Node nextNode()
next().public void remove()
remove in interface java.util.Iteratorpublic void setRoot(Node root)
root.root - the root node of the subtree