Class ReverseGraph<N>

java.lang.Object
pascal.taie.util.graph.ReverseGraph<N>
Type Parameters:
N - type of nodes.
All Implemented Interfaces:
Serializable, Iterable<N>, Graph<N>

public class ReverseGraph<N> extends Object implements Graph<N>
A reverse view of given graph.
See Also:
  • Constructor Details

    • ReverseGraph

      public ReverseGraph(Graph<N> graph)
  • Method Details

    • hasEdge

      public boolean hasEdge(N source, N target)
      Specified by:
      hasEdge in interface Graph<N>
      Returns:
      true if this graph has an edge from given source to target, otherwise false.
    • getPredsOf

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

      public Set<N> getSuccsOf(N node)
      Specified by:
      getSuccsOf in interface Graph<N>
      Returns:
      the successors of given node in this graph.
    • getNodes

      public Set<N> getNodes()
      Specified by:
      getNodes in interface Graph<N>
      Returns:
      all nodes of this graph.