Module org.jgrapht.core
Class BlossomVTree.TreeEdgeIterator
java.lang.Object
org.jgrapht.alg.matching.blossom.v5.BlossomVTree.TreeEdgeIterator
- All Implemented Interfaces:
Iterator<BlossomVTreeEdge>
- Enclosing class:
BlossomVTree
An iterator over tree edges incident to this tree.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The direction of thecurrentEdge
private BlossomVTreeEdge
The tree edge this iterator is currently onprivate BlossomVTreeEdge
Variable to determine whether currentEdge has been returned or not -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BlossomVTreeEdge
advance()
Moves this iterator to the next tree edge.int
Returns the direction of the current edgeboolean
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
-
currentDirection
private int currentDirectionThe direction of thecurrentEdge
-
currentEdge
The tree edge this iterator is currently on -
result
Variable to determine whether currentEdge has been returned or not
-
-
Constructor Details
-
TreeEdgeIterator
public TreeEdgeIterator()Constructs a new TreeEdgeIterator
-
-
Method Details
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<BlossomVTreeEdge>
-
next
- Specified by:
next
in interfaceIterator<BlossomVTreeEdge>
-
getCurrentDirection
public int getCurrentDirection()Returns the direction of the current edge- Returns:
- the direction of the current edge
-
advance
Moves this iterator to the next tree edge. If the last outgoing edge has been traversed, changes the current direction to 1. If the the last incoming edge has been traversed, setscurrentEdge
to null.- Returns:
- the next tree edge or null if all edges have been traversed already
-