realized there were two print statements in regression testin different SESEs, breaks...
[IRC.git] / Robust / src / Analysis / MLP / WaitingElement.java
1 package Analysis.MLP;
2
3 import java.util.HashSet;
4 import java.util.Iterator;
5
6 public class WaitingElement {
7
8         private int waitingID;
9         private int status;
10         private HashSet<Integer> allocList;
11
12         public WaitingElement() {
13                 this.allocList = new HashSet<Integer>();
14         }
15
16         public void setWaitingID(int waitingID) {
17                 this.waitingID = waitingID;
18         }
19
20         public int getWaitingID() {
21                 return waitingID;
22         }
23
24         public void setStatus(int status) {
25                 this.status = status;
26         }
27
28         public int getStatus() {
29                 return status;
30         }
31
32         public HashSet<Integer> getAllocList() {
33                 return allocList;
34         }
35
36         public void setAllocList(HashSet<Integer> allocList) {
37                 this.allocList.addAll(allocList);
38         }
39
40         public boolean equals(Object o) {
41
42                 if (o == null) {
43                         return false;
44                 }
45
46                 if (!(o instanceof WaitingElement)) {
47                         return false;
48                 }
49
50                 WaitingElement in = (WaitingElement) o;
51
52                 if (waitingID == in.getWaitingID() && status == in.getStatus()
53                                 && allocList.equals(in.getAllocList())) {
54                         return true;
55                 } else {
56                         return false;
57                 }
58
59         }
60
61         public String toString() {
62                 return "[waitingID=" + waitingID + " status=" + status + " allocList="
63                                 + allocList + "]";
64         }
65
66         public int hashCode() {
67
68                 int hash = 1;
69
70                 hash = hash * 31 + waitingID;
71
72                 hash += status;
73
74                 for (Iterator iterator = allocList.iterator(); iterator.hasNext();) {
75                         Integer type = (Integer) iterator.next();
76                         hash += type.intValue();
77                 }
78
79                 return hash;
80
81         }
82
83 }