Package com.jgalgo.alg
Interface Bfs.Iter<V,E>
-
- Type Parameters:
V
- the vertices typeE
- the edges type
- All Superinterfaces:
Iterator<V>
- All Known Subinterfaces:
Bfs.IntIter
- Enclosing interface:
- Bfs
public static interface Bfs.Iter<V,E> extends Iterator<V>
A BFS iterator.- Author:
- Barak Ugav
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasNext()
Check whether there is more vertices to iterate over.E
lastEdge()
Get the edge that led to the last vertex returned bynext()
.int
layer()
Get the layer of the last vertex returned bynext()
.V
next()
Advance the iterator and return a vertex that was not visited by the iterator yet.-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
hasNext
boolean hasNext()
Check whether there is more vertices to iterate over.
-
next
V next()
Advance the iterator and return a vertex that was not visited by the iterator yet.
-
lastEdge
E lastEdge()
Get the edge that led to the last vertex returned bynext()
.The behavior is undefined if
next()
was not called yet.- Returns:
- the edge that led to the last vertex returned by
next()
-
layer
int layer()
Get the layer of the last vertex returned bynext()
.The layer of a vertex is the cardinality distance, the number of edges in the path, from the source(s) to the vertex.
The behavior is undefined if
next()
was not called yet.- Returns:
- the layer of the last vertex returned by
next()
.
-
-