changes: building field/method hierarchy graph + inserting combination nodes at the...
[IRC.git] / Robust / src / Analysis / SSJava / HNode.java
1 package Analysis.SSJava;
2
3 import IR.Descriptor;
4
5 public class HNode {
6
7   private String name;
8   private Descriptor desc;
9
10   private boolean isSkeleton;
11   private boolean isCombinationNode;
12   private boolean isSharedNode;
13
14   public HNode() {
15     this.isSkeleton = false;
16     this.isCombinationNode = false;
17     this.isSharedNode = false;
18   }
19
20   public HNode(String name) {
21     this();
22     this.name = name;
23   }
24
25   public HNode(Descriptor d) {
26     this();
27     this.desc = d;
28     this.name = d.getSymbol();
29   }
30
31   public boolean isSharedNode() {
32     return isSharedNode;
33   }
34
35   public void setSharedNode(boolean b) {
36     this.isSharedNode = b;
37   }
38
39   public boolean isSkeleton() {
40     return isSkeleton;
41   }
42
43   public void setSkeleton(boolean isSkeleton) {
44     this.isSkeleton = isSkeleton;
45   }
46
47   public boolean isCombinationNode() {
48     return isCombinationNode;
49   }
50
51   public void setCombinationNode(boolean b) {
52     isCombinationNode = b;
53   }
54
55   public String getName() {
56     return name;
57   }
58
59   public boolean equals(Object o) {
60     if (o instanceof HNode) {
61       HNode in = (HNode) o;
62       if (getName().equals(in.getName())) {
63         return true;
64       }
65     }
66     return false;
67   }
68
69   public String toString() {
70     String isShared = "";
71     if (isSharedNode()) {
72       isShared = "*";
73     }
74     return "[Node::" + name + isShared + "]";
75   }
76
77   public Descriptor getDescriptor() {
78     return desc;
79   }
80
81   public int hashCode() {
82     return 7 + name.hashCode();
83   }
84
85 }