V
- Class of the vertex of the graph.public abstract class BreadthSearchIterator<V extends Vertex> extends SearchIterator<V>
AbstractGraph
<V,E>.parentOf
Constructor and Description |
---|
BreadthSearchIterator(AdjacencyListGraph<V,? extends Edge<V>> graph,
V root) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
protected abstract boolean |
isValidEdge(Edge<V> edge,
V currentVertex)
Abstract method to know if an edge is valid to explore in the breadth algorithm.
|
protected boolean |
isValidVertex(V vertex)
Method to know if a vertex is valid for the breadth algorithm
|
V |
next() |
protected void |
setSearchAll(boolean searchAll)
Setter method for parameter
searchAll |
getParent, isFound, remove
public BreadthSearchIterator(AdjacencyListGraph<V,? extends Edge<V>> graph, V root)
protected void setSearchAll(boolean searchAll)
searchAll
searchAll
- boolean which will be establish as value for the parameter.protected boolean isValidVertex(V vertex)
vertex
- Vertex we want to check.protected abstract boolean isValidEdge(Edge<V> edge, V currentVertex)
edge
- Edge we want to check.currentVertex
- Vertex where the algorithm is exploring currently.public boolean hasNext()
public V next()