Class GraphPlume

java.lang.Object
org.plumelib.util.GraphPlume

public final class GraphPlume extends Object
Graph utility methods. This class does not model a graph: all methods are static.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    This class is a collection of methods; it does not represent anything.
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T extends @NonNull Object>
    Map<T,List<T>>
    dominators(Map<T,List<@KeyFor("#1") T>> predecessors)
    Computes, for each node in the graph, its set of (pre-)dominators.
    static <T extends @NonNull Object>
    void
    print(Map<T,List<T>> graph, PrintStream ps, int indent)
    Print a representation of the graph to ps, indented by intent spaces.

    Methods inherited from class java.lang.Object

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

    • GraphPlume

      private GraphPlume()
      This class is a collection of methods; it does not represent anything.
  • Method Details

    • dominators

      public static <T extends @NonNull Object> Map<T,List<T>> dominators(Map<T,List<@KeyFor("#1") T>> predecessors)
      Computes, for each node in the graph, its set of (pre-)dominators. Supply a successor graph if you want post-dominators.
      Type Parameters:
      T - type of the graph nodes
      Parameters:
      predecessors - a graph, represented as a predecessor map
      Returns:
      a map from each node to a list of its pre-dominators
    • print

      public static <T extends @NonNull Object> void print(Map<T,List<T>> graph, PrintStream ps, int indent)
      Print a representation of the graph to ps, indented by intent spaces.
      Type Parameters:
      T - the type of nodes of the graph
      Parameters:
      graph - the graph to print
      ps - the PrintStream to which to print the graph
      indent - the number of spaces by which to indent the printed representation