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 intThe direction of thecurrentEdgeprivate BlossomVTreeEdgeThe tree edge this iterator is currently onprivate BlossomVTreeEdgeVariable to determine whether currentEdge has been returned or not -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate BlossomVTreeEdgeadvance()Moves this iterator to the next tree edge.intReturns the direction of the current edgebooleanhasNext()next()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
hasNextin interfaceIterator<BlossomVTreeEdge>
-
next
- Specified by:
nextin 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, setscurrentEdgeto null.- Returns:
- the next tree edge or null if all edges have been traversed already
-