soot.toolkits.graph
Class SimpleDominatorsFinder

java.lang.Object
  extended by soot.toolkits.graph.SimpleDominatorsFinder
All Implemented Interfaces:
DominatorsFinder

public class SimpleDominatorsFinder
extends Object
implements DominatorsFinder

Wrapper class for a simple dominators analysis based on a simple flow analysis algorithm. Works with any DirectedGraph with a single head.

Author:
Navindra Umanee

Field Summary
protected  DirectedGraph graph
           
protected  Map<Object,FlowSet> nodeToDominators
           
 
Constructor Summary
SimpleDominatorsFinder(DirectedGraph graph)
          Compute dominators for provided singled-headed directed graph.
 
Method Summary
 List getDominators(Object node)
          Returns a list of dominators for the given node in the graph.
 DirectedGraph getGraph()
          Returns the graph to which the analysis pertains.
 Object getImmediateDominator(Object node)
          Returns the immediate dominator of node or null if the node has no immediate dominator.
 boolean isDominatedBy(Object node, Object dominator)
          True if "node" is dominated by "dominator" in the graph.
 boolean isDominatedByAll(Object node, Collection dominators)
          True if "node" is dominated by all nodes in "dominators" in the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected DirectedGraph graph

nodeToDominators

protected Map<Object,FlowSet> nodeToDominators
Constructor Detail

SimpleDominatorsFinder

public SimpleDominatorsFinder(DirectedGraph graph)
Compute dominators for provided singled-headed directed graph.

Method Detail

getGraph

public DirectedGraph getGraph()
Description copied from interface: DominatorsFinder
Returns the graph to which the analysis pertains.

Specified by:
getGraph in interface DominatorsFinder

getDominators

public List getDominators(Object node)
Description copied from interface: DominatorsFinder
Returns a list of dominators for the given node in the graph.

Specified by:
getDominators in interface DominatorsFinder

getImmediateDominator

public Object getImmediateDominator(Object node)
Description copied from interface: DominatorsFinder
Returns the immediate dominator of node or null if the node has no immediate dominator.

Specified by:
getImmediateDominator in interface DominatorsFinder

isDominatedBy

public boolean isDominatedBy(Object node,
                             Object dominator)
Description copied from interface: DominatorsFinder
True if "node" is dominated by "dominator" in the graph.

Specified by:
isDominatedBy in interface DominatorsFinder

isDominatedByAll

public boolean isDominatedByAll(Object node,
                                Collection dominators)
Description copied from interface: DominatorsFinder
True if "node" is dominated by all nodes in "dominators" in the graph.

Specified by:
isDominatedByAll in interface DominatorsFinder