Class BreadthFirstIteratorWithLevel<V,E>
- java.lang.Object
-
- org.jgrapht.traverse.AbstractGraphIterator<V,E>
-
- org.jgrapht.traverse.CrossComponentIterator<V,E,java.lang.Integer>
-
- org.processmining.OCLPMDiscovery.utils.BreadthFirstIteratorWithLevel<V,E>
-
- Type Parameters:
V- the graph vertex typeE- the graph edge type
- All Implemented Interfaces:
java.util.Iterator<V>,org.jgrapht.traverse.GraphIterator<V,E>
public class BreadthFirstIteratorWithLevel<V,E> extends org.jgrapht.traverse.CrossComponentIterator<V,E,java.lang.Integer>A breadth-first iterator for a directed or undirected graph which supports querying the depth of a vertex in the search tree.For this iterator to work correctly the graph must not be modified during iteration. Currently there are no means to ensure that, nor to fail-fast. The results of such modifications are undefined.
- Since:
- April 21, 2018
- Author:
- Joris Kinable
-
-
Constructor Summary
Constructors Constructor Description BreadthFirstIteratorWithLevel(org.jgrapht.Graph<V,E> g)Creates a new breadth-first iterator for the specified graph.BreadthFirstIteratorWithLevel(org.jgrapht.Graph<V,E> g, V startVertex)Creates a new breadth-first iterator for the specified graph.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidencounterVertex(V vertex, E edge)protected voidencounterVertexAgain(V vertex, E edge)intgetDepth(V v)protected booleanisConnectedComponentExhausted()protected VprovideNextVertex()-
Methods inherited from class org.jgrapht.traverse.CrossComponentIterator
finishVertex, getGraph, getSeenData, hasNext, isSeenVertex, next, putSeenData
-
Methods inherited from class org.jgrapht.traverse.AbstractGraphIterator
addTraversalListener, fireConnectedComponentFinished, fireConnectedComponentStarted, fireEdgeTraversed, fireVertexFinished, fireVertexTraversed, isCrossComponentTraversal, isReuseEvents, remove, removeTraversalListener, setCrossComponentTraversal, setReuseEvents
-
-
-
-
Constructor Detail
-
BreadthFirstIteratorWithLevel
public BreadthFirstIteratorWithLevel(org.jgrapht.Graph<V,E> g)
Creates a new breadth-first iterator for the specified graph.- Parameters:
g- the graph to be iterated.
-
BreadthFirstIteratorWithLevel
public BreadthFirstIteratorWithLevel(org.jgrapht.Graph<V,E> g, V startVertex)
Creates a new breadth-first iterator for the specified graph. Iteration will start at the specified start vertex and will be limited to the connected component that includes that vertex. If the specified start vertex isnull, iteration will start at an arbitrary vertex and will not be limited, that is, will be able to traverse all the graph.- Parameters:
g- the graph to be iterated.startVertex- the vertex iteration to be started.
-
-
Method Detail
-
isConnectedComponentExhausted
protected boolean isConnectedComponentExhausted()
-
provideNextVertex
protected V provideNextVertex()
-
getDepth
public int getDepth(V v)
-
-