Committing changes to leftsize->rightSize, more comments, and handling
[repair.git] / Repair / RepairCompiler / MCC / IR / MultUpdateNode.java
1 package MCC.IR;
2 import java.util.*;
3
4 class MultUpdateNode {
5     Vector updates;
6     AbstractRepair abstractrepair;
7     ScopeNode scopenode;
8     int op;
9     static public final int ADD=0;
10     static public final int REMOVE=1;
11     static public final int MODIFY=2;
12
13     public MultUpdateNode(AbstractRepair ar, int op) {
14         updates=new Vector();
15         abstractrepair=ar;
16         this.op=op;
17     }
18
19     public String toString() {
20         String st="";
21         for(int i=0;i<updates.size();i++)
22             st+=updates.get(i).toString()+"OR\n";
23         return st;
24     }
25
26     public MultUpdateNode(ScopeNode sn) {
27         updates=new Vector();
28         scopenode=sn;
29         op=MultUpdateNode.REMOVE;
30     }
31
32     public Descriptor getDescriptor() {
33         if (abstractrepair!=null)
34             return abstractrepair.getDescriptor();
35         else
36             return scopenode.getDescriptor();
37     }
38     void addUpdate(UpdateNode un) {
39         updates.add(un);
40     }
41     int numUpdates() {
42         return updates.size();
43     }
44     AbstractRepair getRepair() {
45         return abstractrepair;
46     }
47     UpdateNode getUpdate(int i) {
48         return (UpdateNode)updates.get(i);
49     }
50 }