Interface Graph.GraphConsumer<T,U>

Type Parameters:
T - The node value type.
U - The edge value type
Enclosing interface:
Graph<T,U>

public static interface Graph.GraphConsumer<T,U>
Consumer interface for graph traversal.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    consume(T origin, T destination, U edgeValue, int depth, boolean isLast)
    Called by the graph during traversal to handle each node in the graph.
  • Method Details

    • consume

      boolean consume(T origin, T destination, U edgeValue, int depth, boolean isLast)
      Called by the graph during traversal to handle each node in the graph. The parameters passed in constitute an edge between two nodes. This method will not visit detached clusters of nodes.
      Parameters:
      origin - The origin node value.
      destination - The destination node value.
      edgeValue - The edge value.
      depth - The current depth in the graph.
      isLast - If this is the last node at this depth.
      Returns:
      True if the traversal should continue down from the destination node. False if the traversal should exit and resume from the origin node.