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 int hashcode = label.hashCode()^target.hashCode()^source.hashCode()^td.hashCode()^parameterindex^executeTime;
81 if(newObjInfos != null) {
82 hashcode ^= newObjInfos.hashCode();
87 public TaskDescriptor getTask() {
91 public int getIndex() {
92 return parameterindex;
95 public boolean equals(Object o) {
96 if (o instanceof FEdge) {
98 if (e.label.equals(label)&&
99 e.target.equals(target)&&
100 e.source.equals(source) &&
102 e.parameterindex==parameterindex &&
103 e.executeTime == executeTime) {
104 if(this.newObjInfos != null) {
105 if(e.newObjInfos == null) {
108 return e.newObjInfos.equals(this.newObjInfos);
117 public int getExeTime() {
118 return this.executeTime;
121 public void setExeTime(int eTime) {
122 this.executeTime = eTime;
125 public Hashtable<ClassDescriptor, NewObjInfo> getNewObjInfoHashtable() {
126 return this.newObjInfos;
129 public NewObjInfo getNewObjInfo(ClassDescriptor cd) {
130 if(this.newObjInfos == null) {
133 return this.newObjInfos.get(cd);
136 public void addNewObjInfo(ClassDescriptor cd, int newRate, int probability) {
137 if(this.newObjInfos == null) {
138 this.newObjInfos = new Hashtable<ClassDescriptor, NewObjInfo>();
140 this.newObjInfos.put(cd, new NewObjInfo(newRate, probability));