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