Fix tabbing.... Please fix your editors so they do tabbing correctly!!! (Spaces...
[IRC.git] / Robust / src / Analysis / OwnershipAnalysis / MethodContextQWrapper.java
1 package Analysis.OwnershipAnalysis;
2
3 import IR.*;
4 import IR.Flat.*;
5 import java.util.*;
6 import java.io.*;
7
8 public class MethodContextQWrapper implements Comparable {
9
10   private int priority;
11   private MethodContext mc;
12
13   public MethodContextQWrapper(Integer p, MethodContext m) {
14     priority = p.intValue();
15     mc = m;
16   }
17
18   public MethodContextQWrapper(int p, MethodContext m) {
19     priority = p;
20     mc = m;
21   }
22
23   public MethodContext getMethodContext() {
24     return mc;
25   }
26
27   public int compareTo(Object o) throws ClassCastException {
28
29     if( !(o instanceof MethodContextQWrapper) ) {
30       throw new ClassCastException();
31     }
32
33     MethodContextQWrapper mcqw = (MethodContextQWrapper) o;
34     return priority - mcqw.priority;
35   }
36
37   public boolean equals(Object o) {
38     if( o == null ) {
39       return false;
40     }
41
42     if( !( o instanceof MethodContextQWrapper) ) {
43       return false;
44     }
45
46     MethodContextQWrapper mcqw = (MethodContextQWrapper) o;
47
48     return mc.equals(mcqw.mc);
49   }
50 }