KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > xquery > parser > XQueryBinaryOperatorExpression


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23
24 package org.xquark.xquery.parser;
25
26
27
28 // START_COMMON
29

30 public abstract class XQueryBinaryOperatorExpression extends XQueryExpression implements Cloneable JavaDoc {
31     private static final String JavaDoc RCSRevision = "$Revision: 1.5 $";
32     private static final String JavaDoc RCSName = "$Name: $";
33     
34     XQueryExpression expression1 = null;
35     XQueryExpression expression2 = null;
36     
37     // #############################################################################
38
// VISITOR STUFF
39
// #############################################################################
40

41     public void accept(ParserVisitor visitor) throws XQueryException {
42         visitor.visit(this);
43     }
44     
45     // #############################################################################
46
// CONSTRUCTOR STUFF
47
// #############################################################################
48

49     // public XQueryBinaryOperatorExpression()
50
// {
51
// }
52

53     public XQueryBinaryOperatorExpression(XQueryExpression expression1, XQueryExpression expression2) throws XQueryException {
54         setExpression1(expression1);
55         setExpression2(expression2);
56     }
57     
58     // #############################################################################
59
// ATTRIBUTE ACCESS STUFF
60
// #############################################################################
61

62     public XQueryExpression getExpression1() { return expression1; }
63     public void setExpression1(XQueryExpression expression1) throws XQueryException {
64         if (expression1 == null) throw new XQueryException("expression1 of XQueryBinaryOperatorExpression cannot be null");
65         this.expression1 = expression1;
66         this.expression1.setParentModule(parentModule);
67         this.expression1.setParentExpression(this);
68     }
69     
70     public XQueryExpression getExpression2() { return expression2; }
71     public void setExpression2(XQueryExpression expression2) throws XQueryException {
72         if (expression2 == null) throw new XQueryException("expression2 of XQueryBinaryOperatorExpression cannot be null");
73         this.expression2 = expression2;
74         this.expression2.setParentModule(parentModule);
75         this.expression2.setParentExpression(this);
76     }
77     
78     public XQueryExpression getLeftOperand() { return expression1; }
79     
80     public XQueryExpression getRightOperand() { return expression2; }
81     
82     // #############################################################################
83
// CLONE STUFF
84
// #############################################################################
85
public void addParentExpression(XQueryExpression parentExpression) {
86         addParentExpression(parentExpression) ;
87         expression1.addParentExpression(parentExpression);
88         expression2.addParentExpression(parentExpression);
89     }
90     
91     
92 }
93
94
95
96
Popular Tags