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;
15 public Location(ClassDescriptor cd, String loc) {
21 public Location(ClassDescriptor cd) {
25 public void setType(int type) {
29 public ClassDescriptor getClassDescriptor() {
33 public String getLocIdentifier() {
37 public int getType() {
41 public boolean equals(Object o) {
42 if (!(o instanceof Location)) {
46 Location loc = (Location) o;
48 if (loc.getClassDescriptor().equals(getClassDescriptor())) {
49 if (loc.getLocIdentifier() == null || getLocIdentifier() == null) {
50 if (loc.getType() == getType()) {
54 if (loc.getLocIdentifier().equals(getLocIdentifier())) {
63 public int hashCode() {
65 int hash = cd.hashCode();
67 hash += loc.hashCode();
73 public String toString() {
74 return "Loc[" + cd.getSymbol() + "." + loc + "]";
77 public static Location createTopLocation(ClassDescriptor cd) {
78 Location topLoc = new Location(cd);
84 public static Location createBottomLocation(ClassDescriptor cd) {
85 Location bottomLoc = new Location(cd);
86 bottomLoc.setType(BOTTOM);
87 bottomLoc.loc = "_bottom_";