1
2
3
4 package net.sf.bddbddb.ir.highlevel;
5
6 import java.util.LinkedList;
7 import java.util.List;
8 import net.sf.bddbddb.Relation;
9 import net.sf.bddbddb.ir.Operation;
10 import net.sf.javabdd.BDDFactory;
11 import net.sf.javabdd.BDDFactory.BDDOp;
12
13 /***
14 * Join
15 *
16 * @author jwhaley
17 * @version $Id: Join.java 328 2004-10-16 02:45:30Z joewhaley $
18 */
19 public class Join extends BooleanOperation {
20 List
21
22 /***
23 * @param r0
24 * @param r1
25 * @param r2
26 */
27 public Join(Relation r0, Relation r1, Relation r2) {
28 super(r0, r1, r2);
29 this.attributes = new LinkedList();
30 this.attributes.addAll(r1.getAttributes());
31 this.attributes.retainAll(r2.getAttributes());
32 }
33
34
35
36
37
38
39 public String getName() {
40 return "join";
41 }
42
43
44
45
46
47
48 public Object visit(HighLevelOperationVisitor i) {
49 return i.visit(this);
50 }
51
52
53
54
55
56
57 public BDDOp getBDDOp() {
58 return BDDFactory.and;
59 }
60
61 public Operation copy() {
62 return new Join(r0, r1, r2);
63 }
64
65
66 /***
67 * @return the attributes that are being joined
68 */
69 public List getAttributes(){ return attributes; }
70 }