Package org.graph4j
Interface VertexIterator<V>
- Type Parameters:
V- the type of vertex labels.
public interface VertexIterator<V>
An iterator over all the vertices of a graph.
- Author:
- Cristian Frăsinaru
-
Method Summary
-
Method Details
-
hasNext
boolean hasNext()Returnstrueif the iteration has more vertices. If it returnstrue, thenext()method would return a vertex rather than throwing an exception.- Returns:
trueif the iteration has more vertices.
-
next
int next()Returns the next vertex in the iteration.- Returns:
- the next vertex in the iteration.
- Throws:
NoSuchElementException- if the iteration has no more vertices.
-
setWeight
void setWeight(double weight) - Parameters:
weight- the weight to be set for the current vertex.
-
getWeight
double getWeight()- Returns:
- the weight of the current vertex.
-
setLabel
- Parameters:
label- the label to be set for the current vertex.
-
getLabel
V getLabel()- Returns:
- the label of the current vertex.
-
remove
void remove()Removes the current vertex from the graph.
-