1 19 20 package soot.toolkits.graph; 21 22 import soot.*; 23 import soot.toolkits.scalar.*; 24 import soot.toolkits.graph.*; 25 import soot.jimple.*; 26 import java.util.*; 27 import soot.util.*; 28 29 37 public class DominatorNode 38 { 39 protected Object gode; 40 protected DominatorNode parent; 41 protected List children; 42 43 protected DominatorNode(Object gode) 44 { 45 this.gode = gode; 46 children = new ArrayList(); 47 } 48 49 53 public void setParent(DominatorNode parent) 54 { 55 this.parent = parent; 56 } 57 58 62 public boolean addChild(DominatorNode child) 63 { 64 if(children.contains(child)){ 65 return false; 66 } 67 else{ 68 children.add(child); 69 return true; 70 } 71 } 72 73 77 public Object getGode() 78 { 79 return gode; 80 } 81 82 85 public DominatorNode getParent() 86 { 87 return parent; 88 } 89 90 94 public List getChildren() 95 { 96 return children; 97 } 98 99 102 public boolean isHead() 103 { 104 if(parent == null) 105 return true; 106 else 107 return false; 108 } 109 110 113 public boolean isTail() 114 { 115 if(children.size() == 0) 116 return true; 117 else 118 return false; 119 } 120 121 public String toString() 122 { 123 return gode.toString(); 125 } 126 } 127 | Popular Tags |