1 package Analysis.SSJava;
3 import IR.ClassDescriptor;
5 public class Location {
7 public static final int TOP = 1;
8 public static final int NORMAL = 2;
9 public static final int BOTTOM = 3;
10 public static final int DELTA = 4;
16 public Location(ClassDescriptor cd, String loc) {
22 public Location(ClassDescriptor cd) {
26 public void setType(int type) {
30 public ClassDescriptor getClassDescriptor() {
34 public String getLocIdentifier() {
38 public int getType() {
42 public boolean equals(Object o) {
43 if (!(o instanceof Location)) {
47 Location loc = (Location) o;
49 if (loc.getClassDescriptor().equals(getClassDescriptor())) {
50 if (loc.getLocIdentifier() == null || getLocIdentifier() == null) {
51 if (loc.getType() == getType()) {
55 if (loc.getLocIdentifier().equals(getLocIdentifier())) {
64 public int hashCode() {
66 int hash = cd.hashCode();
68 hash += loc.hashCode();
74 public String toString() {
75 return "Loc[" + cd.getSymbol() + "." + loc + "]";
78 public static Location createTopLocation(ClassDescriptor cd) {
79 Location topLoc = new Location(cd);
85 public static Location createBottomLocation(ClassDescriptor cd) {
86 Location bottomLoc = new Location(cd);
87 bottomLoc.setType(BOTTOM);
88 bottomLoc.loc = "_bottom_";