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 int
currentDirection
The direction of thecurrentEdge
private BlossomVTreeEdge
currentEdge
The tree edge this iterator is currently onprivate BlossomVTreeEdge
result
Variable 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 BlossomVTreeEdge
advance()
Moves this iterator to the next tree edge.int
getCurrentDirection()
Returns the direction of the current edgeboolean
hasNext()
BlossomVTreeEdge
next()
-
-
-
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:
hasNext
in interfacejava.util.Iterator<BlossomVTreeEdge>
-
next
public BlossomVTreeEdge next()
- Specified by:
next
in 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, setscurrentEdge
to null.- Returns:
- the next tree edge or null if all edges have been traversed already
-
-