|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsoot.toolkits.graph.DominatorTree
public class DominatorTree
Constructs a dominator tree structure from the given DominatorsFinder. The nodes in DominatorTree are of type DominatorNode.
Note: DominatorTree does not currently implement DirectedGraph since it provides 4 methods of navigating the nodes where the meaning of getPredsOf and getSuccsOf diverge from the usual meaning in a DirectedGraph implementation.
If you need a DirectedGraph implementation, see DominatorTreeAdapter.
Field Summary | |
---|---|
protected DominatorsFinder |
dominators
|
protected HashMap |
godeToDode
"gode" is a node in the original graph, "dode" is a node in the dominator tree. |
protected DirectedGraph |
graph
|
protected DominatorNode |
head
|
protected ArrayList |
tails
|
Constructor Summary | |
---|---|
DominatorTree(DominatorsFinder dominators)
|
Method Summary | |
---|---|
protected void |
buildTree()
Add all the necessary links between nodes to form a meaningful tree structure. |
protected DominatorNode |
fetchDode(Object gode)
Convenience method, ensures we don't create more than one DominatorNode for a given block. |
protected DominatorNode |
fetchParent(Object gode)
|
List |
getChildrenOf(DominatorNode node)
Returns the children of node in the tree. |
DominatorNode |
getDode(Object gode)
Returns the DominatorNode for a given node in the original DirectedGraph. |
DirectedGraph |
getGraph()
Returns the original graph to which the Dominator tree pertains. |
DominatorNode |
getHead()
Returns the root of the dominator tree. |
DominatorNode |
getParentOf(DominatorNode node)
Returns the parent of node in the tree, null if the node is at the root. |
List<DominatorNode> |
getPredsOf(DominatorNode node)
Finds all the predecessors of node in the original DirectedGraph and returns a list of the corresponding DominatorNodes. |
List<DominatorNode> |
getSuccsOf(DominatorNode node)
Finds all the successors of node in the original DirectedGraph and returns a list of the corresponding DominatorNodes. |
List |
getTails()
Returns a list of the tails of the dominator tree. |
boolean |
isDominatorOf(DominatorNode dom,
DominatorNode node)
Returns true if dom dominates node. |
boolean |
isImmediateDominatorOf(DominatorNode idom,
DominatorNode node)
Returns true if idom immediately dominates node. |
Iterator |
iterator()
Returns an iterator over the nodes in the tree. |
int |
size()
Returns the number of nodes in the tree. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected DominatorsFinder dominators
protected DirectedGraph graph
protected DominatorNode head
protected ArrayList tails
protected HashMap godeToDode
Constructor Detail |
---|
public DominatorTree(DominatorsFinder dominators)
Method Detail |
---|
public DirectedGraph getGraph()
public DominatorNode getHead()
public List getTails()
public DominatorNode getParentOf(DominatorNode node)
public List getChildrenOf(DominatorNode node)
public List<DominatorNode> getPredsOf(DominatorNode node)
public List<DominatorNode> getSuccsOf(DominatorNode node)
public boolean isImmediateDominatorOf(DominatorNode idom, DominatorNode node)
public boolean isDominatorOf(DominatorNode dom, DominatorNode node)
public DominatorNode getDode(Object gode)
public Iterator iterator()
public int size()
protected void buildTree()
protected DominatorNode fetchDode(Object gode)
protected DominatorNode fetchParent(Object gode)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |