Package org.graph4j
Interface EdgeIterator<E>
- Type Parameters:
E- the type of edge labels.
An iterator over all the edges of a graph.
In order to iterate over the edges incident with a specific vertex use
Graph.neighborIterator(int).- Author:
- Cristian Frăsinaru
-
Method Summary
Modifier and TypeMethodDescriptiondoublegetData(int dataType) doublegetData(int dataType, double defaultValue) getLabel()doublebooleanhasNext()Returnstrueif the iteration has more edges.voidincData(int dataType, double amount) next()Returns the next edge in the iteration.voidremove()Removes the current edge from the graph.voidsetData(int dataType, double value) voidvoidsetWeight(double weight) Methods inherited from interface java.util.Iterator
forEachRemaining
-
Method Details
-
hasNext
boolean hasNext()Returnstrueif the iteration has more edges. If it returnstrue, thenext()method would return an edge rather than throwing an exception. -
next
Returns the next edge in the iteration.- Specified by:
nextin interfaceIterator<E>- Returns:
- the next edge in the iteration.
- Throws:
NoSuchElementException- if the iteration has no more edges.
-
setWeight
void setWeight(double weight) - Parameters:
weight- the weight to be set for the current edge.
-
getWeight
double getWeight()- Returns:
- the weight of the current edge.
-
setData
void setData(int dataType, double value) -
incData
void incData(int dataType, double amount) -
getData
double getData(int dataType) -
getData
double getData(int dataType, double defaultValue) -
setLabel
- Parameters:
label- the label to be set for the current edge.
-
getLabel
E getLabel()- Returns:
- the label of the current edge.
-
remove
void remove()Removes the current edge from the graph.
-