1 package Analysis.SSJava;
3 import IR.ClassDescriptor;
4 import IR.TypeExtension;
6 public class Location implements TypeExtension {
8 public static final int TOP = 1;
9 public static final int NORMAL = 2;
10 public static final int BOTTOM = 3;
11 public static final int DELTA = 4;
17 public Location(ClassDescriptor cd, String loc) {
23 public Location(ClassDescriptor cd) {
27 public void setType(int type) {
31 public ClassDescriptor getClassDescriptor() {
35 public String getLocIdentifier() {
39 public int getType() {
43 public boolean equals(Object o) {
44 if (!(o instanceof Location)) {
48 Location loc = (Location) o;
50 if (loc.getClassDescriptor().equals(getClassDescriptor())) {
51 if (loc.getLocIdentifier() == null || getLocIdentifier() == null) {
52 if (loc.getType() == getType()) {
56 if (loc.getLocIdentifier().equals(getLocIdentifier())) {
65 public int hashCode() {
67 int hash = cd.hashCode();
69 hash += loc.hashCode();
75 public String toString() {
76 return "Loc[" + cd.getSymbol() + "." + loc + "]";
79 public static Location createTopLocation(ClassDescriptor cd) {
80 Location topLoc = new Location(cd);
86 public static Location createBottomLocation(ClassDescriptor cd) {
87 Location bottomLoc = new Location(cd);
88 bottomLoc.setType(BOTTOM);
89 bottomLoc.loc = "_bottom_";
93 public boolean isTop() {