bug fix on the glb function of the lattice + working on the checking with the composi...
[IRC.git] / Robust / src / Analysis / SSJava / CompositeLocation.java
index bed509d82bef30b8fecc14eae8afd756109e256c..df13d0ca441a984e7f717c97f131504c7a0c5bce 100644 (file)
@@ -70,7 +70,46 @@ public class CompositeLocation extends Location {
     return baseLocationSet;
   }
 
+  public int getNumofDelta() {
+
+    int result = 0;
+
+    if (locTuple.size() == 1) {
+      Location locElement = locTuple.at(0);
+      if (locElement instanceof DeltaLocation) {
+        result++;
+        result += getNumofDelta((DeltaLocation) locElement);
+      }
+    }
+    return result;
+  }
+
+  public int getNumofDelta(DeltaLocation delta) {
+    int result = 0;
+
+    if (delta.getDeltaOperandLocationVec().size() == 1) {
+      Location locElement = delta.getDeltaOperandLocationVec().get(0);
+      if (locElement instanceof DeltaLocation) {
+        result++;
+        result += getNumofDelta((DeltaLocation) locElement);
+      }
+    }
+
+    return result;
+  }
+
   public String toString() {
+
+    // for better representation
+    // if compositeLoc has only one single location,
+    // just print out single location
+    // if(locTuple.size()==1){
+    // Location locElement=locTuple.at(0);
+    // if(locElement instanceof Location){
+    // return locElement.toString();
+    // }
+    // }
+
     String rtr = "CompLoc[";
 
     int tupleSize = locTuple.size();