1 package Analysis.SSJava;
5 import IR.ClassDescriptor;
7 import IR.TypeDescriptor;
9 public class DeltaLocation extends CompositeLocation {
11 private Descriptor refOperand = null;
13 public DeltaLocation(ClassDescriptor cd) {
17 public DeltaLocation(ClassDescriptor cd, Set<Location> set) {
22 public DeltaLocation(ClassDescriptor cd, Descriptor refOperand) {
24 this.refOperand = refOperand;
27 public Descriptor getRefLocationId() {
28 return this.refOperand;
31 public void addDeltaOperand(Location op) {
32 locTuple.addElement(op);
35 public NTuple<Location> getDeltaOperandLocationVec() {
39 // public Set<Location> getBaseLocationSet() {
41 // if (operandVec.size() == 1 && (operandVec.get(0) instanceof DeltaLocation))
43 // // nested delta definition
44 // DeltaLocation deltaLoc = (DeltaLocation) operandVec.get(0);
45 // return deltaLoc.getBaseLocationSet();
47 // Set<Location> set = new HashSet<Location>();
48 // set.addAll(operandVec);
54 public boolean equals(Object o) {
56 if (!(o instanceof DeltaLocation)) {
60 DeltaLocation deltaLoc = (DeltaLocation) o;
62 if (deltaLoc.getDeltaOperandLocationVec().equals(getDeltaOperandLocationVec())) {
68 public int hashCode() {
69 int hash = cd.hashCode();
70 hash += locTuple.hashCode();
71 if (refOperand != null) {
72 hash += refOperand.hashCode();
77 public String toString() {
78 String rtr = "delta(";
80 if (locTuple.size() != 0) {
81 int tupleSize = locTuple.size();
82 for (int i = 0; i < tupleSize; i++) {
83 Location locElement = locTuple.at(i);