1 package Analysis.TaskStateAnalysis;
3 import Analysis.TaskStateAnalysis.*;
9 /* Edge *****************/
11 public class FEdge extends Edge {
14 private TaskDescriptor td;
15 private int parameterindex;
18 private int executeTime;
19 private Hashtable<ClassDescriptor, NewObjInfo> newObjInfos;
21 public class NewObjInfo {
30 public NewObjInfo(int newRate, int probability) {
31 this.newRate = newRate;
32 this.probability = probability;
35 public int getNewRate() {
39 public void setNewRate(int newRate) {
40 this.newRate = newRate;
43 public int getProbability() {
44 return this.probability;
47 public void setProbability(int probability) {
48 this.probability = probability;
51 public boolean equals(Object o) {
52 if (o instanceof NewObjInfo) {
53 NewObjInfo e=(NewObjInfo)o;
54 if (e.newRate == this.newRate &&
55 e.probability == this.probability) {
66 public FEdge(FlagState target, String label, TaskDescriptor td, int parameterindex) {
70 this.parameterindex=parameterindex;
71 this.executeTime = -1;
72 this.newObjInfos = null;
75 public String getLabel() {
79 public int hashCode(){
80 return target.hashCode()^label.hashCode();
83 public TaskDescriptor getTask() {
87 public int getIndex() {
88 return parameterindex;
91 public boolean equals(Object o) {
92 if (o instanceof FEdge) {
94 if (e.label.equals(label)&&
95 e.target.equals(target)&&
96 e.source.equals(source) &&
98 e.parameterindex==parameterindex &&
99 e.executeTime == executeTime) {
100 if(this.newObjInfos != null) {
101 if(e.newObjInfos == null) {
103 } else if(e.newObjInfos.equals(this.newObjInfos)) {
112 public int getExeTime() {
113 return this.executeTime;
116 public void setExeTime(int eTime) {
117 this.executeTime = eTime;
120 public Hashtable<ClassDescriptor, NewObjInfo> getNewObjInfoHashtable() {
121 return this.newObjInfos;
124 public NewObjInfo getNewObjInfo(ClassDescriptor cd) {
125 if(this.newObjInfos == null) {
128 return this.newObjInfos.get(cd);
131 public void addNewObjInfo(ClassDescriptor cd, int newRate, int probability) {
132 if(this.newObjInfos == null) {
133 this.newObjInfos = new Hashtable<ClassDescriptor, NewObjInfo>();
135 this.newObjInfos.put(cd, new NewObjInfo(newRate, probability));