Added new file.
[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     public boolean equals(java.lang.Object o) {
28         if (!(o instanceof SizeObject))
29             return false;
30         SizeObject so=(SizeObject)o;
31         if (so.setorrelation!=setorrelation)
32             return false;
33         if (so.isRelation!=isRelation)
34             throw new Error("");
35         if (isRelation) {
36             if (so.set!=set)
37                 return false;
38             if (so.isInverted!=isInverted)
39                 return false;
40         }
41         return true;
42     }
43 }