Module org.jgrapht.core
Class BlossomVNode.IncidentEdgeIterator
- java.lang.Object
-
- org.jgrapht.alg.matching.blossom.v5.BlossomVNode.IncidentEdgeIterator
-
- All Implemented Interfaces:
java.util.Iterator<BlossomVEdge>
- Enclosing class:
- BlossomVNode
public class BlossomVNode.IncidentEdgeIterator extends java.lang.Object implements java.util.Iterator<BlossomVEdge>
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
Fields Modifier and Type Field Description private intcurrentDirThe direction of the current edgeprivate intnextDirDirection of thenextEdgeprivate BlossomVEdgenextEdgeThe edge that will be returned after the next call tonext().
-
Constructor Summary
Constructors Constructor Description IncidentEdgeIterator()Constructs a new instance of the IncidentEdgeIterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidadvance()Advances this iterator to the next incident edge.intgetDir()Returns the direction of the edge returned by this iteratorbooleanhasNext()BlossomVEdgenext()
-
-
-
Field Detail
-
currentDir
private int currentDir
The direction of the current edge
-
nextDir
private int nextDir
Direction of thenextEdge
-
nextEdge
private BlossomVEdge 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.
-
-
Method Detail
-
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:
hasNextin interfacejava.util.Iterator<BlossomVEdge>
-
next
public BlossomVEdge next()
- Specified by:
nextin interfacejava.util.Iterator<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, thennextEdgebecomes null.
-
-