Package org.graph4j

Interface EdgeIterator<E>

Type Parameters:
E - the type of edge labels.
All Superinterfaces:
Iterator<Edge<E>>

public interface EdgeIterator<E> extends Iterator<Edge<E>>
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 Type
    Method
    Description
    double
    getData(int dataType)
     
    double
    getData(int dataType, double defaultValue)
     
     
    double
     
    boolean
    Returns true if the iteration has more edges.
    void
    incData(int dataType, double amount)
     
    Returns the next edge in the iteration.
    void
    Removes the current edge from the graph.
    void
    setData(int dataType, double value)
     
    void
    setLabel(E label)
     
    void
    setWeight(double weight)
     

    Methods inherited from interface java.util.Iterator

    forEachRemaining
  • Method Details

    • hasNext

      boolean hasNext()
      Returns true if the iteration has more edges. If it returns true, the next() method would return an edge rather than throwing an exception.
      Specified by:
      hasNext in interface Iterator<E>
      Returns:
      true if the iteration has more edges.
    • next

      Edge<E> next()
      Returns the next edge in the iteration.
      Specified by:
      next in interface Iterator<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

      void setLabel(E label)
      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.
      Specified by:
      remove in interface Iterator<E>