get set up part of the stall site analysis
[IRC.git] / Robust / src / Analysis / Disjoint / StallSite.java
1 package Analysis.Disjoint;
2
3 import java.util.HashSet;
4 import java.util.Set;
5
6 public class StallSite {
7
8         private HashSet<Effect> effectSet;
9         private HashSet<AllocSite> allocSiteSet;
10
11         public StallSite(Set<AllocSite> allocSet) {
12                 effectSet = new HashSet<Effect>();
13                 allocSiteSet = new HashSet<AllocSite>();
14                 allocSiteSet.addAll(allocSet);
15         }
16
17         public void addEffect(Effect e) {
18                 effectSet.add(e);
19         }
20
21         public HashSet<Effect> getEffectSet() {
22                 return effectSet;
23         }
24
25         public Set<AllocSite> getAllocSiteSet(){
26           return allocSiteSet;
27         }
28
29         public boolean equals(Object o) {
30
31                 if (o == null) {
32                         return false;
33                 }
34
35                 if (!(o instanceof StallSite)) {
36                         return false;
37                 }
38
39                 StallSite in = (StallSite) o;
40
41                 if (allocSiteSet.equals(in.getAllocSiteSet())
42                                 && effectSet.equals(in.getEffectSet()) ){
43                         return true;
44                 } else {
45                         return false;
46                 }
47
48         }
49
50         @Override
51         public String toString() {
52                 return "StallSite [allocationSiteSet=" + allocSiteSet
53                                 + ", effectSet=" + effectSet + "]";
54         }
55 }