Updates
[repair.git] / Repair / RepairCompiler / MCC / IR / Conjunction.java
1 package MCC.IR;
2 import java.util.*;
3
4 public class Conjunction {
5
6     Vector predicates;
7     public Conjunction(DNFPredicate pred) {
8         predicates=new Vector();
9         predicates.add(pred);
10     }
11     Conjunction(Vector preds){
12         predicates=preds       ;
13     }
14
15     int size() {
16         return predicates.size();
17     }
18     
19     DNFPredicate get(int i) {
20         return (DNFPredicate) predicates.get(i);
21     }
22
23     void add(DNFPredicate dp) {
24         predicates.add(dp);
25     }
26
27     public Conjunction append(Conjunction c) {
28         Conjunction copy=copy();
29         for(int i=0;i<c.size();i++) {
30             copy.add(new DNFPredicate(c.get(i)));
31         }
32         return copy;
33     }
34
35     public Conjunction copy() {
36         Vector vector=new Vector();
37         for (int i=0;i<size();i++) {
38             DNFPredicate dp=get(i);
39             vector.add(new DNFPredicate(dp));
40         }
41         return new Conjunction(vector);
42     }
43 }