Small changes to allow:
[repair.git] / Repair / RepairCompiler / MCC / IR / SizeObject.java
1 package MCC.IR;
2
3 class SizeObject {
4     Descriptor setorrelation;
5     boolean isRelation;
6     SetDescriptor set;
7     boolean isInverted;
8
9     public SizeObject(SetDescriptor sd) {
10         this.setorrelation=sd;
11         this.isRelation=false;
12     }
13
14     public SizeObject(RelationDescriptor rd, SetDescriptor sd,boolean inverted) {
15         this.isRelation=true;
16         this.setorrelation=rd;
17         this.set=sd;
18         this.isInverted=inverted;
19     }
20
21     public int hashCode() {
22         int hashcode=setorrelation.hashCode();
23         if (set!=null)
24             hashcode^=set.hashCode();
25         return hashcode;
26     }
27
28     public boolean equals(java.lang.Object o) {
29         if (!(o instanceof SizeObject))
30             return false;
31         SizeObject so=(SizeObject)o;
32         if (so.setorrelation!=setorrelation)
33             return false;
34         if (so.isRelation!=isRelation)
35             throw new Error("");
36         if (isRelation) {
37             if (so.set!=set)
38                 return false;
39             if (so.isInverted!=isInverted)
40                 return false;
41         }
42         return true;
43     }
44 }