move method effects analysis into disjoint analysis.
[IRC.git] / Robust / src / Analysis / OwnershipAnalysis / EffectsKey.java
1 package Analysis.OwnershipAnalysis;
2
3 import Analysis.MLP.AccKey;
4 import IR.TypeDescriptor;
5
6 public class EffectsKey {
7
8         private String fd;
9         private TypeDescriptor td;
10
11         public EffectsKey(String fd, TypeDescriptor td) {
12                 this.fd = fd;
13                 this.td = td;
14         }
15
16         public String getFieldDescriptor() {
17                 return fd;
18         }
19
20         public TypeDescriptor getTypeDescriptor() {
21                 return td;
22         }
23
24         public String toString() {
25                 return "(" + td + ")" + fd;
26         }
27
28         public int hashCode() {
29
30                 int hash = 1;
31
32                 if (fd != null) {
33                         hash = hash * 31 + fd.hashCode();
34                 }
35
36                 if (td != null) {
37                         hash += td.getSymbol().hashCode();
38                 }
39
40                 return hash;
41
42         }
43
44         public boolean equals(Object o) {
45
46                 if (o == null) {
47                         return false;
48                 }
49
50                 if (!(o instanceof EffectsKey)) {
51                         return false;
52                 }
53
54                 EffectsKey in = (EffectsKey) o;
55
56                 if (fd.equals(in.getFieldDescriptor())
57                                 && td.getSymbol().equals(in.getTypeDescriptor().getSymbol())) {
58                         return true;
59                 } else {
60                         return false;
61                 }
62
63         }
64 }