Change to the spec...missed a consistency property. Adding timing option.
[repair.git] / Repair / RepairCompiler / MCC / IR / MultUpdateNode.java
index fdddbebec9c17872b8b22ebb5aabca4246fa728c..277a9edaf7f3f061f5ec486125aea83c893aac65 100755 (executable)
@@ -4,9 +4,40 @@ import java.util.*;
 class MultUpdateNode {
     Vector updates;
     AbstractRepair abstractrepair;
-    public MultUpdateNode(AbstractRepair ar) {
+    ScopeNode scopenode;
+    int op;
+    static public final int ADD=0;
+    static public final int REMOVE=1;
+    static public final int MODIFY=2;
+
+    public MultUpdateNode(AbstractRepair ar, int op) {
        updates=new Vector();
        abstractrepair=ar;
+       this.op=op;
+    }
+
+    public int getType() {
+       return op;
+    }
+
+    public String toString() {
+       String st="";
+       for(int i=0;i<updates.size();i++)
+           st+=updates.get(i).toString()+"OR\n";
+       return st;
+    }
+
+    public MultUpdateNode(ScopeNode sn) {
+       updates=new Vector();
+       scopenode=sn;
+       op=MultUpdateNode.REMOVE;
+    }
+
+    public Descriptor getDescriptor() {
+       if (abstractrepair!=null)
+           return abstractrepair.getDescriptor();
+       else
+           return scopenode.getDescriptor();
     }
     void addUpdate(UpdateNode un) {
        updates.add(un);