Interface Graph<N>

Type Parameters:
N - the node parameter type
All Known Implementing Classes:
InheritanceGraph
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface Graph<N>
A minimal functional interface for graph-structured data.
  • Method Summary

    Modifier and Type
    Method
    Description
    Iterable<? extends N>
    successors(N node)
    Returns all nodes in this graph directly adjacent to node which can be reached by traversing node's outgoing edges.
    default Iterable<N>
    traverse(TraversalAlgorithm algorithm, N startNode)
    Returns an iterable which will traverse this graph using the specified algorithm starting at the given node.
  • Method Details

    • successors

      Iterable<? extends N> successors(N node)
      Returns all nodes in this graph directly adjacent to node which can be reached by traversing node's outgoing edges.
      Throws:
      IllegalArgumentException - if node is not an element of this graph
    • traverse

      default Iterable<N> traverse(TraversalAlgorithm algorithm, N startNode)
      Returns an iterable which will traverse this graph using the specified algorithm starting at the given node.
      Parameters:
      algorithm - the algorithm to use when traversing
      startNode - the start node in the inheritance graph
      Returns:
      an iterable