Module org.jgrapht.core
Class BlossomVTree.TreeEdgeIterator
- java.lang.Object
-
- org.jgrapht.alg.matching.blossom.v5.BlossomVTree.TreeEdgeIterator
-
- All Implemented Interfaces:
java.util.Iterator<BlossomVTreeEdge>
- Enclosing class:
- BlossomVTree
public class BlossomVTree.TreeEdgeIterator extends java.lang.Object implements java.util.Iterator<BlossomVTreeEdge>
An iterator over tree edges incident to this tree.
-
-
Field Summary
Fields Modifier and Type Field Description private intcurrentDirectionThe direction of thecurrentEdgeprivate BlossomVTreeEdgecurrentEdgeThe tree edge this iterator is currently onprivate BlossomVTreeEdgeresultVariable to determine whether currentEdge has been returned or not
-
Constructor Summary
Constructors Constructor Description TreeEdgeIterator()Constructs a new TreeEdgeIterator
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private BlossomVTreeEdgeadvance()Moves this iterator to the next tree edge.intgetCurrentDirection()Returns the direction of the current edgebooleanhasNext()BlossomVTreeEdgenext()
-
-
-
Field Detail
-
currentDirection
private int currentDirection
The direction of thecurrentEdge
-
currentEdge
private BlossomVTreeEdge currentEdge
The tree edge this iterator is currently on
-
result
private BlossomVTreeEdge result
Variable to determine whether currentEdge has been returned or not
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<BlossomVTreeEdge>
-
next
public BlossomVTreeEdge next()
- Specified by:
nextin interfacejava.util.Iterator<BlossomVTreeEdge>
-
getCurrentDirection
public int getCurrentDirection()
Returns the direction of the current edge- Returns:
- the direction of the current edge
-
advance
private BlossomVTreeEdge 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
-
-