KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > expression > booleanvalueexpression > parenthesizedbooleanvalueexpression


1 package com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression;
2
3 import com.daffodilwoods.daffodildb.server.sql99.common.*;
4 import com.daffodilwoods.daffodildb.server.sql99.dql.execution.*;
5 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition.*;
6 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.table.*;
7 import com.daffodilwoods.daffodildb.server.sql99.expression.rowvalueexpression.*;
8 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
9 import com.daffodilwoods.database.resource.*;
10 import com.daffodilwoods.database.sqlinitiator.*;
11 import com.daffodilwoods.daffodildb.server.sql99.dql.execution._SingleTableCondition;
12
13 /**
14  * <p>Title: parenthesizedbooleanvalueexpression</p>
15  * <p>Description:
16  * This class represets ParenthesizedBVE
17  * It provides the functionality of Bve Execution Plan and execution of the
18  * condition.
19  * </p>
20  * <p>Copyright: Copyright (c) 2003</p>
21  * <p>Company: Daffodil S/W Ltd.</p>
22  * @author SelectTeam
23  * @version 1.0
24  */

25
26 public class parenthesizedbooleanvalueexpression extends AbstractBooleanValueExpression implements booleanprimary, JoinConditionTableGetter,_SingleTableCondition /*, _BooleanPrimary*/ {
27
28    public booleanvalueexpression _booleanvalueexpression0;
29
30    public parenthesizedbooleanvalueexpression() {
31    }
32
33    public parenthesizedbooleanvalueexpression(booleanvalueexpression bve) {
34       this._booleanvalueexpression0 = bve;
35    }
36
37    public double getCost(long rowCount, boolean index) throws DException {
38       return _booleanvalueexpression0.getCost(rowCount, index);
39    }
40
41    public _QualifiedBVE getQualifiedBVE(TableDetails[] tableDetails) throws DException {
42       return _booleanvalueexpression0.getQualifiedBVE(tableDetails);
43    }
44
45    public int canUseForSeek() throws DException {
46       return _booleanvalueexpression0.canUseForSeek();
47    }
48
49    public _IndexPredicateInterface getCost(_Order order, String JavaDoc[] queryColumns, Object JavaDoc session, TableDetails tableDetail, ColumnDetails[] aggregateColumns) throws DException {
50       return _booleanvalueexpression0.getCost(order, queryColumns, session, tableDetail, aggregateColumns);
51    }
52
53    public void setColumnPredicates(_AllColumnPredicates allColumnPredicates) throws DException {
54       _booleanvalueexpression0.setColumnPredicates(allColumnPredicates);
55    }
56
57    public int getConditionType() throws DException {
58       return _booleanvalueexpression0.getConditionType();
59    }
60
61    public _BVEPlan getExecutionPlan() throws DException {
62       return _booleanvalueexpression0.getExecutionPlan();
63    }
64
65    public Object JavaDoc run(Object JavaDoc object) throws com.daffodilwoods.database.resource.DException {
66       return _booleanvalueexpression0.run(object);
67    }
68
69    public ParameterInfo[] getParameterInfo() throws DException {
70       return _booleanvalueexpression0.getParameterInfo();
71    }
72
73    public TableDetails[] getCorrespondingTablesInvolved(TableDetails[] td) throws com.daffodilwoods.database.resource.DException {
74       if (_booleanvalueexpression0 instanceof JoinConditionTableGetter) {
75          return ( (JoinConditionTableGetter) _booleanvalueexpression0).getCorrespondingTablesInvolved(td);
76       }
77       return null;
78    }
79
80    /**
81     * This method is used to verify the values given by the user
82     * corresponding to join-condition specified.
83     * If the values given mismatchs the join condition, exception is thrown.
84     */

85
86    public void verifyValues(_VariableValueOperations vv) throws DException {
87       if (_booleanvalueexpression0 instanceof JoinConditionTableGetter) {
88          ( (JoinConditionTableGetter) _booleanvalueexpression0).verifyValues(vv);
89       }
90    }
91
92    public AbstractRowValueExpression[] getChilds() {
93       AbstractRowValueExpression[] childs = new AbstractRowValueExpression[] { (AbstractRowValueExpression) (_booleanvalueexpression0)};
94       return childs;
95    }
96
97    public long getEstimatedRows(long noOfRows) throws DException {
98       return _booleanvalueexpression0.getEstimatedRows(noOfRows);
99    }
100
101    public boolean isNullPredicate() throws DException {
102       return _booleanvalueexpression0.isNullPredicate();
103    }
104
105    public String JavaDoc toString() {
106       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
107       sb.append(" ");
108       sb.append("(");
109       sb.append(" ");
110       sb.append(_booleanvalueexpression0);
111       sb.append(" ");
112       sb.append(")");
113       return sb.toString();
114    }
115
116    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
117       parenthesizedbooleanvalueexpression tempClass = new parenthesizedbooleanvalueexpression();
118       tempClass._booleanvalueexpression0 = (booleanvalueexpression) _booleanvalueexpression0.clone();
119       try {
120          tempClass.getColumnDetails();
121       } catch (DException ex) {
122          throw new RuntimeException JavaDoc(ex.getMessage());
123       }
124       return tempClass;
125    }
126
127    public booleanvalueexpression getSingleTableCondition() throws DException {
128       if (_booleanvalueexpression0 instanceof _SingleTableCondition) {
129         return ((_SingleTableCondition)_booleanvalueexpression0).getSingleTableCondition();
130       } else {
131          throw new DException("DSE0", new Object JavaDoc[] {"Not handled the condition " + _booleanvalueexpression0.getClass().getName()});
132       }
133    }
134 }
135
Popular Tags