01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 1997-2006.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.query.algebra;
07:
08: import java.util.LinkedHashSet;
09: import java.util.Set;
10:
11: /**
12: * A natural join between two tuple expressions.
13: */
14: public class Join extends BinaryTupleOperator {
15:
16: /*--------------*
17: * Constructors *
18: *--------------*/
19:
20: public Join() {
21: }
22:
23: /**
24: * Creates a new natural join operator.
25: */
26: public Join(TupleExpr leftArg, TupleExpr rightArg) {
27: super (leftArg, rightArg);
28: }
29:
30: /*---------*
31: * Methods *
32: *---------*/
33:
34: public Set<String> getBindingNames() {
35: Set<String> bindingNames = new LinkedHashSet<String>(16);
36: bindingNames.addAll(getLeftArg().getBindingNames());
37: bindingNames.addAll(getRightArg().getBindingNames());
38: return bindingNames;
39: }
40:
41: public <X extends Exception> void visit(QueryModelVisitor<X> visitor)
42: throws X {
43: visitor.meet(this );
44: }
45:
46: @Override
47: public Join clone() {
48: return (Join) super.clone();
49: }
50: }
|