Fix tabbing.... Please fix your editors so they do tabbing correctly!!! (Spaces...
[IRC.git] / Robust / src / Analysis / Disjoint / HrnIdOoc.java
1 package Analysis.Disjoint;
2
3 import IR.*;
4 import IR.Flat.*;
5 import java.util.*;
6 import java.io.*;
7
8 // a heap region node has an integer ID, but heap regions can
9 // also have reach tuples with the same ID but out-of-context
10 // so 17 and 17? mean something different in reachability states
11 public class HrnIdOoc {
12   protected Integer id;
13   protected Boolean ooc;
14
15   public HrnIdOoc(Integer id, Boolean ooc) {
16     this.id  = id;
17     this.ooc = ooc;
18   }
19
20   public Integer getId() {
21     return id;
22   }
23
24   public Boolean getOoc() {
25     return ooc;
26   }
27
28   public boolean equals(Object o) {
29     if( o == null ) {
30       return false;
31     }
32
33     if( !(o instanceof HrnIdOoc) ) {
34       return false;
35     }
36
37     HrnIdOoc hio = (HrnIdOoc) o;
38
39     return
40       id.equals(hio.id)  &&
41       ooc.equals(hio.ooc);
42   }
43
44   public int hashCode() {
45     int hash = id.intValue();
46     if( ooc.booleanValue() ) {
47       hash = ~hash;
48     }
49     return hash;
50   }
51
52   public String toString() {
53     String s = id.toString();
54
55     if( ooc ) {
56       s += "?";
57     }
58
59     return s;
60   }
61 }