Interface Graph<N>

Type Parameters:
N - type of nodes
All Superinterfaces:
Iterable<N>, Serializable
All Known Subinterfaces:
CallGraph<CallSite,Method>, CFG<N>, ICFG<Method,Node>
All Known Implementing Classes:
AbstractCallGraph, CSCallGraph, DefaultCallGraph, MergedSCCGraph, ObjectFlowGraph, PointerFlowGraph, ReverseGraph, SimpleGraph

public interface Graph<N> extends Iterable<N>, Serializable
Representation of a directed graph.
  • Method Details

    • hasNode

      default boolean hasNode(N node)
      Returns:
      true if this graph has given node, otherwise false.
    • hasEdge

      default boolean hasEdge(N source, N target)
      Returns:
      true if this graph has an edge from given source to target, otherwise false.
    • hasEdge

      default boolean hasEdge(Edge<N> edge)
      Returns:
      true if this graph has the given edge, otherwise false.
    • getPredsOf

      Set<N> getPredsOf(N node)
      Returns:
      the predecessors of given node in this graph.
    • getSuccsOf

      Set<N> getSuccsOf(N node)
      Returns:
      the successors of given node in this graph.
    • getInEdgesOf

      default Set<? extends Edge<N>> getInEdgesOf(N node)
      Returns:
      incoming edges of the given node.
    • getInDegreeOf

      default int getInDegreeOf(N node)
      Returns:
      the number of in edges of the given node.
    • getOutEdgesOf

      default Set<? extends Edge<N>> getOutEdgesOf(N node)
      Returns:
      outgoing edges of the given node.
    • getOutDegreeOf

      default int getOutDegreeOf(N node)
      Returns:
      the number of out edges of the given node.
    • getNodes

      Set<N> getNodes()
      Returns:
      all nodes of this graph.
    • getNumberOfNodes

      default int getNumberOfNodes()
      Returns:
      the number of the nodes in this graph.
    • iterator

      default Iterator<N> iterator()
      Specified by:
      iterator in interface Iterable<N>