public class FEdge extends Edge {
- private String label;
- private TaskDescriptor td;
- private int parameterindex;
-
- // jzhou
- private int executeTime;
- private Hashtable<ClassDescriptor, NewObjInfo> newObjInfos;
- private int probability;
- private int invokeNum;
- private int expInvokeNum;
-
- public class NewObjInfo {
- int newRate;
- int probability;
- FlagState root;
- int invokeNum;
-
- public NewObjInfo() {
- newRate = 0;
- probability = 0;
- root = null;
- invokeNum = 0;
- }
-
- public NewObjInfo(int newRate, int probability) {
- this.newRate = newRate;
- this.probability = probability;
- }
-
- public int getNewRate() {
- return this.newRate;
- }
-
- public void setNewRate(int newRate) {
- this.newRate = newRate;
- }
-
- public int getProbability() {
- return this.probability;
- }
-
- public void setProbability(int probability) {
- this.probability = probability;
- }
-
- public FlagState getRoot() {
- return root;
- }
+ private String label;
+ private TaskDescriptor td;
+ private int parameterindex;
- public void setRoot(FlagState root) {
- this.root = root;
- }
+ // jzhou
+ private int executeTime;
+ private Hashtable<ClassDescriptor, NewObjInfo> newObjInfos;
+ private int probability;
+ private int invokeNum;
+ private int expInvokeNum;
- public int getInvokeNum() {
- return invokeNum;
- }
+ public class NewObjInfo {
+ int newRate;
+ int probability;
+ FlagState root;
+ int invokeNum;
- public void incInvokeNum() {
- this.invokeNum++;
- }
+ public NewObjInfo() {
+ newRate = 0;
+ probability = 0;
+ root = null;
+ invokeNum = 0;
+ }
- public boolean equals(Object o) {
- if (o instanceof NewObjInfo) {
- NewObjInfo e=(NewObjInfo)o;
- if (e.newRate == this.newRate &&
- e.probability == this.probability &&
- e.invokeNum == this.invokeNum &&
- e.root.equals(this.root)) {
- return true;
- }
- }
- return false;
- }
+ public NewObjInfo(int newRate, int probability) {
+ this.newRate = newRate;
+ this.probability = probability;
}
-
- /** Class Constructor
- *
- */
- public FEdge(FlagState target, String label, TaskDescriptor td, int parameterindex) {
- super(target);
- this.label = label;
- this.td=td;
- this.parameterindex=parameterindex;
- this.executeTime = -1;
- this.newObjInfos = null;
- this.probability = -1;
- this.invokeNum = 0;
- this.expInvokeNum = 0;
+
+ public int getNewRate() {
+ return this.newRate;
+ }
+
+ public void setNewRate(int newRate) {
+ this.newRate = newRate;
}
public int getProbability() {
- return probability;
+ return this.probability;
}
public void setProbability(int probability) {
- this.probability = probability;
+ this.probability = probability;
}
- public String getLabel() {
- return label;
+ public FlagState getRoot() {
+ return root;
}
-
- public int hashCode(){
- int hashcode = label.hashCode()^target.hashCode()^source.hashCode()^parameterindex^executeTime;
- if (td!=null)
- hashcode^=td.hashCode();
- if(newObjInfos != null) {
- hashcode ^= newObjInfos.hashCode();
- }
- return hashcode;
+
+ public void setRoot(FlagState root) {
+ this.root = root;
}
- public TaskDescriptor getTask() {
- return td;
+ public int getInvokeNum() {
+ return invokeNum;
}
- public int getIndex() {
- return parameterindex;
+ public void incInvokeNum() {
+ this.invokeNum++;
}
-
+
public boolean equals(Object o) {
- if (o instanceof FEdge) {
- FEdge e=(FEdge)o;
- if (e.label.equals(label)&&
- e.target.equals(target)&&
- e.source.equals(source) &&
- e.td==td&&
- e.parameterindex==parameterindex &&
- e.executeTime == executeTime) {
- if(this.newObjInfos != null) {
- if(e.newObjInfos == null) {
- return false;
- } else {
- return e.newObjInfos.equals(this.newObjInfos);
- }
- }
- return true;
- }
- }
- return false;
- }
-
- public int getExeTime() {
- return this.executeTime;
- }
-
- public void setExeTime(int eTime) {
- this.executeTime = eTime;
- }
-
- public Hashtable<ClassDescriptor, NewObjInfo> getNewObjInfoHashtable() {
- return this.newObjInfos;
- }
-
- public NewObjInfo getNewObjInfo(ClassDescriptor cd) {
- if(this.newObjInfos == null) {
- return null;
- }
- return this.newObjInfos.get(cd);
- }
-
- public void addNewObjInfo(ClassDescriptor cd, int newRate, int probability) {
- if(this.newObjInfos == null) {
- this.newObjInfos = new Hashtable<ClassDescriptor, NewObjInfo>();
- }
- this.newObjInfos.put(cd, new NewObjInfo(newRate, probability));
- }
-
- public void process() {
- this.invokeNum++;
+ if (o instanceof NewObjInfo) {
+ NewObjInfo e=(NewObjInfo)o;
+ if (e.newRate == this.newRate &&
+ e.probability == this.probability &&
+ e.invokeNum == this.invokeNum &&
+ e.root.equals(this.root)) {
+ return true;
+ }
+ }
+ return false;
}
+ }
- public int getInvokeNum() {
- return invokeNum;
+ /** Class Constructor
+ *
+ */
+ public FEdge(FlagState target, String label, TaskDescriptor td, int parameterindex) {
+ super(target);
+ this.label = label;
+ this.td=td;
+ this.parameterindex=parameterindex;
+ this.executeTime = -1;
+ this.newObjInfos = null;
+ this.probability = -1;
+ this.invokeNum = 0;
+ this.expInvokeNum = 0;
+ }
+
+ public int getProbability() {
+ return probability;
+ }
+
+ public void setProbability(int probability) {
+ this.probability = probability;
+ }
+
+ public String getLabel() {
+ return label;
+ }
+
+ public int hashCode() {
+ int hashcode = label.hashCode()^target.hashCode()^source.hashCode()^parameterindex^executeTime;
+ if (td!=null)
+ hashcode^=td.hashCode();
+ if(newObjInfos != null) {
+ hashcode ^= newObjInfos.hashCode();
+ }
+ return hashcode;
+ }
+
+ public TaskDescriptor getTask() {
+ return td;
+ }
+
+ public int getIndex() {
+ return parameterindex;
+ }
+
+ public boolean equals(Object o) {
+ if (o instanceof FEdge) {
+ FEdge e=(FEdge)o;
+ if (e.label.equals(label)&&
+ e.target.equals(target)&&
+ e.source.equals(source) &&
+ e.td==td&&
+ e.parameterindex==parameterindex &&
+ e.executeTime == executeTime) {
+ if(this.newObjInfos != null) {
+ if(e.newObjInfos == null) {
+ return false;
+ } else {
+ return e.newObjInfos.equals(this.newObjInfos);
+ }
+ }
+ return true;
+ }
}
+ return false;
+ }
+
+ public int getExeTime() {
+ return this.executeTime;
+ }
+
+ public void setExeTime(int eTime) {
+ this.executeTime = eTime;
+ }
- public int getInvokeNumGap() {
- return expInvokeNum - invokeNum;
+ public Hashtable<ClassDescriptor, NewObjInfo> getNewObjInfoHashtable() {
+ return this.newObjInfos;
+ }
+
+ public NewObjInfo getNewObjInfo(ClassDescriptor cd) {
+ if(this.newObjInfos == null) {
+ return null;
}
+ return this.newObjInfos.get(cd);
+ }
- public void setExpInvokeNum(int expInvokeNum) {
- this.expInvokeNum = expInvokeNum;
+ public void addNewObjInfo(ClassDescriptor cd, int newRate, int probability) {
+ if(this.newObjInfos == null) {
+ this.newObjInfos = new Hashtable<ClassDescriptor, NewObjInfo>();
}
-
+ this.newObjInfos.put(cd, new NewObjInfo(newRate, probability));
+ }
+
+ public void process() {
+ this.invokeNum++;
+ }
+
+ public int getInvokeNum() {
+ return invokeNum;
+ }
+
+ public int getInvokeNumGap() {
+ return expInvokeNum - invokeNum;
+ }
+
+ public void setExpInvokeNum(int expInvokeNum) {
+ this.expInvokeNum = expInvokeNum;
+ }
+
}