Fixed some analysis problems...
[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 int getType() {
20         return op;
21     }
22
23     public String toString() {
24         String st="";
25         for(int i=0;i<updates.size();i++)
26             st+=updates.get(i).toString()+"OR\n";
27         return st;
28     }
29
30     public MultUpdateNode(ScopeNode sn) {
31         updates=new Vector();
32         scopenode=sn;
33         op=MultUpdateNode.REMOVE;
34     }
35
36     public Descriptor getDescriptor() {
37         if (abstractrepair!=null)
38             return abstractrepair.getDescriptor();
39         else
40             return scopenode.getDescriptor();
41     }
42     void addUpdate(UpdateNode un) {
43         updates.add(un);
44     }
45     int numUpdates() {
46         return updates.size();
47     }
48     AbstractRepair getRepair() {
49         return abstractrepair;
50     }
51     UpdateNode getUpdate(int i) {
52         return (UpdateNode)updates.get(i);
53     }
54 }