public class SimpleDominatorsFinder<N> extends java.lang.Object implements DominatorsFinder<N>
Modifier and Type | Field and Description |
---|---|
protected DirectedGraph<N> |
graph |
protected java.util.Map<N,FlowSet<N>> |
nodeToDominators |
Constructor and Description |
---|
SimpleDominatorsFinder(DirectedGraph<N> graph)
Compute dominators for provided singled-headed directed graph.
|
Modifier and Type | Method and Description |
---|---|
java.util.List<N> |
getDominators(N node)
Returns a list of dominators for the given node in the graph.
|
DirectedGraph<N> |
getGraph()
Returns the graph to which the analysis pertains.
|
N |
getImmediateDominator(N node)
Returns the immediate dominator of node or null if the node has
no immediate dominator.
|
boolean |
isDominatedBy(N node,
N dominator)
True if "node" is dominated by "dominator" in the graph.
|
boolean |
isDominatedByAll(N node,
java.util.Collection<N> dominators)
True if "node" is dominated by all nodes in "dominators" in the graph.
|
protected DirectedGraph<N> graph
public SimpleDominatorsFinder(DirectedGraph<N> graph)
public DirectedGraph<N> getGraph()
DominatorsFinder
getGraph
in interface DominatorsFinder<N>
public java.util.List<N> getDominators(N node)
DominatorsFinder
getDominators
in interface DominatorsFinder<N>
public N getImmediateDominator(N node)
DominatorsFinder
getImmediateDominator
in interface DominatorsFinder<N>
public boolean isDominatedBy(N node, N dominator)
DominatorsFinder
isDominatedBy
in interface DominatorsFinder<N>
public boolean isDominatedByAll(N node, java.util.Collection<N> dominators)
DominatorsFinder
isDominatedByAll
in interface DominatorsFinder<N>