64617e90dd2e80130077bc5a8bc64d42b03228b3
[IRC.git] / Robust / src / Analysis / Disjoint / EdgeKey.java
1 public class EdgeKey {
2   private Integer srcId;
3   private Integer dstId;
4   private FieldDescriptor f;
5
6   public EdgeKey(Integer srcId, Integer dstId, FieldDescriptor f) {
7     this.srcId = srcId;
8     this.dstId = dstId;
9     this.f     = f;
10   }
11
12   public Integer getSrcId() {
13     return srcId;
14   }
15
16   public Integer getDstId() {
17     return dstId;
18   }
19
20   public FieldDescriptor getField() {
21     return f;
22   }
23
24   public boolean equals(Object o) {
25     if(this == o) {
26       return true;
27     }
28     if(o == null) {
29       return false;
30     }
31     if(!(o instanceof EdgeKey)) {
32       return false;
33     }
34
35     EdgeKey ek = (EdgeKey) o;
36
37     return 
38       this.srcId.equals(ek.srcId) &&
39       this.dstId.equals(ek.dstId) &&
40       this.f.equals(ek.f);
41   }
42
43   public int hashCode() {
44     return srcId.hashCode() ^ dstId.hashCode() ^ f.hashCode();
45   }
46 }