Class InverseGraph<N>

  • Type Parameters:
    N -
    All Implemented Interfaces:
    Iterable<N>, DirectedGraph<N>

    public class InverseGraph<N>
    extends Object
    implements DirectedGraph<N>
    An inverted graph of a directed graph.
    Author:
    Eric Bodden
    • Method Detail

      • getHeads

        public List<N> getHeads()
        Returns a list of entry points for this graph.
        Specified by:
        getHeads in interface DirectedGraph<N>
      • getPredsOf

        public List<N> getPredsOf​(N s)
        Returns a list of predecessors for the given node in the graph.
        Specified by:
        getPredsOf in interface DirectedGraph<N>
      • getSuccsOf

        public List<N> getSuccsOf​(N s)
        Returns a list of successors for the given node in the graph.
        Specified by:
        getSuccsOf in interface DirectedGraph<N>
      • getTails

        public List<N> getTails()
        Returns a list of exit points for this graph.
        Specified by:
        getTails in interface DirectedGraph<N>
      • iterator

        public Iterator<N> iterator()
        Returns an iterator for the nodes in this graph. No specific ordering of the nodes is guaranteed.
        Specified by:
        iterator in interface DirectedGraph<N>
        Specified by:
        iterator in interface Iterable<N>
      • size

        public int size()
        Returns the node count for this graph.
        Specified by:
        size in interface DirectedGraph<N>