java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
de.grogra.xl.util.ObjectList
de.grogra.graph.impl.TreeIterator
- All Implemented Interfaces:
ObjectConsumer
,VoidToObjectGenerator
,Serializable
,Cloneable
,Iterable
,Collection
,Iterator
,List
,RandomAccess
This
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.- Author:
- Ole Kniemeyer
- See Also:
-
Field Summary
Fields inherited from class de.grogra.xl.util.ObjectList
elements, size, useEquals
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionCreate a new iterator.TreeIterator
(Node root) Creates a new iterator iterating over the subtree starting atroot
. -
Method Summary
Methods inherited from class de.grogra.xl.util.ObjectList
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, values
Methods inherited from class java.util.AbstractList
addAll, iterator, listIterator, listIterator, removeRange, subList
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Iterator
forEachRemaining
Methods inherited from interface java.util.List
containsAll, removeAll, replaceAll, retainAll, sort, spliterator
-
Constructor Details
-
TreeIterator
public TreeIterator()Create a new iterator. It has to be configured bysetRoot(Node)
before it is used. -
TreeIterator
Creates a new iterator iterating over the subtree starting atroot
.- Parameters:
root
- the root node of the subtree
-
-
Method Details
-
setRoot
Configures this iterator to iterate over the subtree starting atroot
.- Parameters:
root
- the root node of the subtree
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
nextNode
Returns the next node of this iterator. This is equivalent tonext()
.- Returns:
- the next node of this iterator
-