KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > tableexpression > fromclause > datedframework


1 package com.daffodilwoods.daffodildb.server.sql99.dql.tableexpression.fromclause;
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.expression.booleanvalueexpression.*;
7 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.predicates.*;
8 import com.daffodilwoods.daffodildb.server.sql99.expression.datetimevalueexpression.*;
9 import com.daffodilwoods.daffodildb.server.sql99.token.*;
10 import com.daffodilwoods.daffodildb.utils.parser.*;
11 import com.daffodilwoods.database.resource.*;
12
13 /**
14  * DatedFramework represents the dated condition for a single table. Dated
15  * condition is "from > first and to < second" where 'from' and 'to' are the
16  * columns of the table. first and second represents the first date time
17  * value expression and second date time value expression resp.
18  * <p>Title: </p>
19  * <p>Description: </p>
20  * <p>Copyright: Copyright (c) 2003</p>
21  * <p>Company: </p>
22  * @author unascribed
23  * @version 1.0
24  */

25
26 public class datedframework implements StatementExecuter, _DatedFramework {
27   /**
28    * It reperesents From> first datetime expression
29    */

30   public datetimevalueexpression _datetimevalueexpression0;
31   /**
32    * It represents keyword comma ','
33    */

34   public Scomma94843605 _Scomma948436051;
35   /**
36    * It represents To>second datetime expression
37    */

38   public datetimevalueexpression _datetimevalueexpression2;
39   /**
40    * It represents detail of all column involved in datedframework
41    */

42   private ColumnDetails[] columnDetails;
43   /**
44    * Note:-For documentation of following method refers to documentation of
45    * _DatedFramework.
46    * @param object
47    * @return
48    * @throws DException
49    */

50    public Object JavaDoc run(Object JavaDoc object) throws DException {
51       return null;
52    }
53
54    public ColumnDetails[] getColumnDetails() throws DException {
55       if (columnDetails != null) {
56          return columnDetails;
57       }
58       columnDetails = _datetimevalueexpression2.getColumnDetails();
59       return columnDetails;
60    }
61
62    public TableDetails getTableDetails() throws DException {
63       for (int i = 0; i < columnDetails.length; i++) {
64          TableDetails table = columnDetails[i].getTable();
65          if (table != null) {
66             return table;
67          }
68       }
69       return null;
70    }
71
72    public booleanvalueexpression getDatedCondition() throws DException {
73       booleanvalueexpression datedCondition1 = BVEPlanMerger.getBooleanFactor(new DatedCondition(OperatorConstants.LESSTHAN, "FROM", _datetimevalueexpression2));
74       booleanvalueexpression datedCondition2 = BVEPlanMerger.getBooleanFactor(new DatedCondition(OperatorConstants.GREATERTHAN, "TO", _datetimevalueexpression2));
75       booleanvalueexpression datedCondition = BVEPlanMerger.addAndConditions(datedCondition1, datedCondition2);
76       return datedCondition;
77    }
78
79    public datetimevalueexpression getDateTimeValueExpressionForInsertionDeletion() throws DException {
80       return _datetimevalueexpression0;
81    }
82
83    public String JavaDoc toString() {
84       StringBuffer JavaDoc sb = new StringBuffer JavaDoc();
85       sb.append(" ");
86       sb.append("(");
87       sb.append(" ");
88       sb.append(_datetimevalueexpression2);
89       sb.append(" ");
90       sb.append(_Scomma948436051);
91       sb.append(" ");
92       sb.append(_datetimevalueexpression0);
93       sb.append(" ");
94       sb.append(")");
95       return sb.toString();
96    }
97
98    public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
99       datedframework tempClass = new datedframework();
100       tempClass._datetimevalueexpression0 = (datetimevalueexpression) _datetimevalueexpression0.clone();
101       tempClass._Scomma948436051 = (Scomma94843605) _Scomma948436051.clone();
102       tempClass._datetimevalueexpression2 = (datetimevalueexpression) _datetimevalueexpression2.clone();
103       return tempClass;
104    }
105
106 }
107
Popular Tags