Module org.jgrapht.core
Class BlossomVNode.IncidentEdgeIterator
java.lang.Object
org.jgrapht.alg.matching.blossom.v5.BlossomVNode.IncidentEdgeIterator
- All Implemented Interfaces:
Iterator<BlossomVEdge>
- Enclosing class:
BlossomVNode
An iterator for traversing the edges incident to this node.
This iterator has a feature that during every step it knows the next edge it'll return to the caller. That's why it is safe to modify the current edge (move it to another node, for example).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
The direction of the current edgeprivate int
Direction of thenextEdge
private BlossomVEdge
The edge that will be returned after the next call tonext()
. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new instance of the IncidentEdgeIterator. -
Method Summary
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
-
currentDir
private int currentDirThe direction of the current edge -
nextDir
private int nextDirDirection of thenextEdge
-
nextEdge
The edge that will be returned after the next call tonext()
. Is null if all incident edges of the current node have been traversed.
-
-
Constructor Details
-
IncidentEdgeIterator
public IncidentEdgeIterator()Constructs a new instance of the IncidentEdgeIterator.
-
-
Method Details
-
getDir
public int getDir()Returns the direction of the edge returned by this iterator- Returns:
- the direction of the edge returned by this iterator
-
hasNext
public boolean hasNext()- Specified by:
hasNext
in interfaceIterator<BlossomVEdge>
-
next
- Specified by:
next
in interfaceIterator<BlossomVEdge>
-
advance
private void advance()Advances this iterator to the next incident edge. If previous edge was the last one with direction 0, then the direction of this iterator changes. If previous edge was the last incident edge, thennextEdge
becomes null.
-