changes: building field/method hierarchy graph + inserting combination nodes at the...
[IRC.git] / Robust / src / Analysis / SSJava / FlowNode.java
index 7ce39ed50055c8c9b4be6140ee22259a3d83ff88..b71789aeda8b3e3dd8677b82b7054b5721d13c19 100644 (file)
@@ -17,21 +17,35 @@ public class FlowNode {
   // this set contains fields of the base type
   private Set<FlowNode> fieldNodeSet;
 
-  // set true if this node is driven from a paramter
-  private boolean isParameter;
-
   // set true if this node stores a return value
   private boolean isReturn;
 
+  private boolean isDeclarationNode = false;
+
+  private boolean isIntermediate;
+
+  private CompositeLocation compLoc;
+
+  private boolean isSkeleton;
+
+  public boolean isIntermediate() {
+    return isIntermediate;
+  }
+
+  public void setIntermediate(boolean isIntermediate) {
+    this.isIntermediate = isIntermediate;
+  }
+
   public Set<FlowNode> getFieldNodeSet() {
     return fieldNodeSet;
   }
 
   private Set<FlowEdge> outEdgeSet;
 
-  public FlowNode(NTuple<Descriptor> tuple, boolean isParam) {
+  public FlowNode(NTuple<Descriptor> tuple) {
 
-    this.isParameter = isParam;
+    this.isSkeleton = false;
+    this.isIntermediate = false;
 
     NTuple<Descriptor> base = null;
     Descriptor desc = null;
@@ -50,14 +64,19 @@ public class FlowNode {
       descTuple.add(desc);
     }
     outEdgeSet = new HashSet<FlowEdge>();
+
   }
 
-  public void addFieldNode(FlowNode node) {
-    fieldNodeSet.add(node);
+  public void setCompositeLocation(CompositeLocation in) {
+    compLoc = in;
+  }
+
+  public CompositeLocation getCompositeLocation() {
+    return compLoc;
   }
 
-  public boolean isParameter() {
-    return isParameter;
+  public void addFieldNode(FlowNode node) {
+    fieldNodeSet.add(node);
   }
 
   public NTuple<Descriptor> getDescTuple() {
@@ -88,8 +107,8 @@ public class FlowNode {
 
   public String toString() {
     String rtr = "[FlowNode]:";
-    if (isParameter()) {
-      rtr += "param:";
+    if (isSkeleton()) {
+      rtr += "SKELETON:";
     }
     rtr += ":" + descTuple;
     return rtr;
@@ -141,6 +160,42 @@ public class FlowNode {
       id += descTuple.get(i).getSymbol();
     }
     id += ">";
+
+    if (compLoc != null) {
+      id += " " + compLoc;
+    }
+
     return id;
   }
+
+  public void setDeclarationNode() {
+    isDeclarationNode = true;
+  }
+
+  public boolean isDeclaratonNode() {
+    return isDeclarationNode;
+  }
+
+  public NTuple<Descriptor> getCurrentDescTuple() {
+
+    if (compLoc == null) {
+      return descTuple;
+    }
+
+    NTuple<Descriptor> curDescTuple = new NTuple<Descriptor>();
+    for (int i = 0; i < compLoc.getSize(); i++) {
+      Location locElement = compLoc.get(i);
+      curDescTuple.add(locElement.getLocDescriptor());
+    }
+    return curDescTuple;
+  }
+
+  public boolean isSkeleton() {
+    return isSkeleton;
+  }
+
+  public void setSkeleton(boolean isSkeleton) {
+    this.isSkeleton = isSkeleton;
+  }
+
 }