Module org.jgrapht.core
Class BlossomVTree.TreeNodeIterator
java.lang.Object
org.jgrapht.alg.matching.blossom.v5.BlossomVTree.TreeNodeIterator
- All Implemented Interfaces:
Iterator<BlossomVNode>
- Enclosing class:
BlossomVTree
An iterator over tree nodes. This iterator traverses the nodes of the tree in a depth-first
order. Note: this iterator can also be used to iterate the nodes of some subtree of a
tree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BlossomVNode
Variable to determine whethercurrentNode
has been returned or notprivate BlossomVNode
The node this iterator is currently onprivate BlossomVNode
A root of the subtree of a tree -
Constructor Summary
ConstructorsConstructorDescriptionTreeNodeIterator
(BlossomVNode root) Constructs a new TreeNodeIterator for aroot
. -
Method Summary
Modifier and TypeMethodDescriptionprivate BlossomVNode
advance()
Advances the iterator to the next tree nodeboolean
hasNext()
next()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
currentNode
The node this iterator is currently on -
current
Variable to determine whethercurrentNode
has been returned or not -
treeRoot
A root of the subtree of a tree
-
-
Constructor Details
-
TreeNodeIterator
Constructs a new TreeNodeIterator for aroot
.Note:
root
doesn't need to be a root of some tree; this iterator also works with subtrees.- Parameters:
root
- node of a tree to start dfs traversal from.
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<BlossomVNode>
-
next
- Specified by:
next
in interfaceIterator<BlossomVNode>
-
advance
Advances the iterator to the next tree node- Returns:
- the next tree node
-