Class Dominators<G extends Graph<G,​N,​E>,​N extends Node<G,​N,​E>,​E extends Edge<G,​N,​E>>

  • Type Parameters:
    G - the type of the target Graphs
    N - the type of Nodes in the target graphs
    E - the type of Edges in the target graphs

    public class Dominators<G extends Graph<G,​N,​E>,​N extends Node<G,​N,​E>,​E extends Edge<G,​N,​E>>
    extends java.lang.Object
    An algorithms that evaluates the dominators of each node in a graph. A node d dominates a node n if every path from an entry node to n must go through d. By definition, every node dominates itself.
    See Also:
    Dominators (graph theory)
    • Constructor Summary

      Constructors 
      Constructor Description
      Dominators()
      Builds the dominators.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Map<N,​java.util.Set<N>> build​(G graph)
      Builds the dominators for the given graph.
      java.util.Map<N,​java.util.Set<N>> getDominators()
      Yelds the last computed dominators through build(Graph).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Dominators

        public Dominators()
        Builds the dominators. To run the algorithm, use build(Graph).
    • Method Detail

      • getDominators

        public java.util.Map<N,​java.util.Set<N>> getDominators()
        Yelds the last computed dominators through build(Graph). The returned value is a map going from each node of the given graph to the set of nodes that dominates it.
        Returns:
        a map containing, for each node of the graph passed as argument to the last call to build(Graph), the set of nodes that dominates it
      • build

        public java.util.Map<N,​java.util.Set<N>> build​(G graph)
        Builds the dominators for the given graph. The returned value, that can also be accessed later through getDominators(), is a map going from each node of the given graph to the set of nodes that dominates it.
        Parameters:
        graph - the graph whose dominators are to be computed
        Returns:
        a map containing, for each node of the graph, the set of nodes that dominates it