1 package Analysis.SSJava;
3 import java.util.HashSet;
6 import java.util.Vector;
8 import IR.ClassDescriptor;
9 import IR.TypeDescriptor;
11 public class DeltaLocation extends CompositeLocation {
13 private TypeDescriptor refOperand = null;
15 public DeltaLocation(ClassDescriptor cd) {
19 public DeltaLocation(ClassDescriptor cd, Set<Location> set) {
24 public DeltaLocation(ClassDescriptor cd, TypeDescriptor refOperand) {
26 this.refOperand = refOperand;
29 public TypeDescriptor getRefLocationId() {
30 return this.refOperand;
33 public void addDeltaOperand(Location op) {
34 locTuple.addElement(op);
37 public NTuple<Location> getDeltaOperandLocationVec() {
41 // public Set<Location> getBaseLocationSet() {
43 // if (operandVec.size() == 1 && (operandVec.get(0) instanceof DeltaLocation))
45 // // nested delta definition
46 // DeltaLocation deltaLoc = (DeltaLocation) operandVec.get(0);
47 // return deltaLoc.getBaseLocationSet();
49 // Set<Location> set = new HashSet<Location>();
50 // set.addAll(operandVec);
56 public boolean equals(Object o) {
58 if (!(o instanceof DeltaLocation)) {
62 DeltaLocation deltaLoc = (DeltaLocation) o;
64 if (deltaLoc.getDeltaOperandLocationVec().equals(getDeltaOperandLocationVec())) {
70 public int hashCode() {
71 int hash = cd.hashCode();
72 hash += locTuple.hashCode();
73 if (refOperand != null) {
74 hash += refOperand.hashCode();
79 public String toString() {
80 String rtr = "delta(";
82 if (locTuple.size() != 0) {
83 int tupleSize = locTuple.size();
84 for (int i = 0; i < tupleSize; i++) {
85 Location locElement = locTuple.at(i);