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 int
currentDir
The direction of the current edgeprivate int
nextDir
Direction of thenextEdge
private BlossomVEdge
nextEdge
The 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 void
advance()
Advances this iterator to the next incident edge.int
getDir()
Returns the direction of the edge returned by this iteratorboolean
hasNext()
BlossomVEdge
next()
-
-
-
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:
hasNext
in interfacejava.util.Iterator<BlossomVEdge>
-
next
public BlossomVEdge next()
- Specified by:
next
in 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, thennextEdge
becomes null.
-
-