1 19 20 package ca.mcgill.sable.soot.launching; 21 22 import java.util.*; 23 24 public class SootConfiguration { 25 26 27 private Vector children; 28 private String label; 29 private SootConfiguration parent; 30 31 34 public SootConfiguration(HashMap aliasValPairs, String name) { 35 super(); 36 setAliasValPairs(aliasValPairs); 37 setName(name); 38 } 39 40 public SootConfiguration(String label) { 41 setLabel(label); 42 } 43 44 private HashMap aliasValPairs; 45 private String name; 46 47 public void addChild(SootConfiguration t) { 48 if (getChildren() == null) { 49 setChildren(new Vector()); 50 } 51 t.setParent(this); 52 getChildren().add(t); 53 } 54 55 public void removeChild(String name) { 56 Iterator it = getChildren().iterator(); 57 SootConfiguration toRemove = null; 58 while (it.hasNext()) { 59 SootConfiguration temp = (SootConfiguration)it.next(); 60 if (temp.getLabel().equals(name)) { 61 toRemove = temp; 62 } 63 } 64 if (toRemove != null) { 65 getChildren().remove(toRemove); 66 } 67 } 68 69 public void renameChild(String oldName, String newName){ 70 Iterator it = getChildren().iterator(); 71 while (it.hasNext()){ 72 SootConfiguration temp = (SootConfiguration)it.next(); 73 if (temp.getLabel().equals(oldName)){ 74 temp.setLabel(newName); 75 } 76 } 77 } 78 79 83 public HashMap getAliasValPairs() { 84 return aliasValPairs; 85 } 86 87 91 public String getName() { 92 return name; 93 } 94 95 99 public void setAliasValPairs(HashMap aliasValPairs) { 100 this.aliasValPairs = aliasValPairs; 101 } 102 103 107 public void setName(String name) { 108 this.name = name; 109 } 110 111 115 public Vector getChildren() { 116 return children; 117 } 118 119 123 public String getLabel() { 124 return label; 125 } 126 127 131 public SootConfiguration getParent() { 132 return parent; 133 } 134 135 139 public void setChildren(Vector children) { 140 this.children = children; 141 } 142 143 147 public void setLabel(String label) { 148 this.label = label; 149 } 150 151 155 public void setParent(SootConfiguration parent) { 156 this.parent = parent; 157 } 158 159 } 160 | Popular Tags |