KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > iterator > _Iterator


1 package com.daffodilwoods.daffodildb.server.sql99.dql.iterator;
2
3 import com.daffodilwoods.daffodildb.server.sql99.dql.execution._OrderCount;
4
5 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents.ColumnMapping;
6
7 import com.daffodilwoods.daffodildb.client.*;
8 import com.daffodilwoods.daffodildb.server.datasystem.interfaces.*;
9 import com.daffodilwoods.daffodildb.server.datasystem.utility._Record;
10 import com.daffodilwoods.daffodildb.server.sql99.common.*;
11 import com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.*;
12 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
13 import com.daffodilwoods.database.resource.*;
14 import com.daffodilwoods.database.sqlinitiator.*;
15
16
17 /**
18  * _Iterator represents the medium to traverse through the records. It allows
19  * user to navigate the records in both forward as well as in backward direction.
20  * <p>Title: </p>
21  * <p>Description: </p>
22  * <p>Copyright: Copyright (c) 2003</p>
23  * <p>Company: </p>
24  * @author unascribed
25  * @version 1.0
26  */

27
28 public interface _Iterator extends _BaseVariableValues,_SqlIndexIterator,_Navigator,_BrowserPlan{
29
30
31    /**
32     * All these constants are needed to maintain the current state of Iterators.
33     */

34
35    /**
36     * BEFOREFIRST means Pointer is just before the first row.
37     */

38
39    public static final int BEFOREFIRST = -7;
40
41    /**
42     * AFTERLAST means Pointer is just after the last row.
43     */

44
45    public static final int AFTERLAST = 7;
46
47    /**
48     * VALIDSTATE means Pointer is at any valid row.
49     */

50
51    public static final int VALIDSTATE = 5;
52
53    /**
54     * INVALIDSTATE is the default state of iterator.
55     */

56
57    public static final int INVALIDSTATE = -5;
58
59    /**
60     * NODATA means that there is no data in Iterator.
61     */

62
63    public static final int NODATA = 3;
64
65    /**
66     * MAX represents the max aggregate function.
67     */

68
69    public static final int MAX = 8;
70
71    /**
72     * MIN represents the min aggregate function.
73     */

74
75    public static final int MIN = 9;
76
77    /**
78     * This method allows a user to get the lowest level iterator of the passed
79     * column. This method is initiated from top level Select Query Iterator. At
80     * top level we maintain a mapping of Selected Column vs. Its base level
81     * Iterator, so as to get the value of that column from the mapping,
82     * rather than to get the value through Iterating the whole tree of Iterator.
83     * It is done for optimization purpose.
84     * @param column
85     * @return
86     * @throws DException
87     */

88
89    _Iterator getBaseIterator(ColumnDetails column) throws DException;
90
91    /**
92     * This method allows the user to get lowest level iterator for the passed
93     * hasRecord column.
94     * @param hasRecordColumn represnts the hasRecord column
95     * @return left join iterator which can return the value of passed column.
96     * @throws DException
97     */

98
99    _Iterator getBaseIteratorHasRecord(ColumnDetails hasRecordColumn) throws DException;
100
101    /**
102     * This method is used to initialize the mapping of table and key count. It
103     * is required when permanent index is used for Group By and we want iterator
104     * to move on GroupBy key, then underlying iterator must know abt the keys of
105     * their underlying iterators. GroupBy key is the columns involved in Group By
106     * @param tableAndKeyCount
107     * @throws DException
108     */

109
110    void setKeyCount(Object JavaDoc[][] tableAndKeyCount) throws DException ;
111
112
113    /**
114     * This method is required when we want to share same iterator with different
115     * values of Parameters. Removes the initialization done for the previous
116     * values of parameters.
117     * @throws DException
118     */

119
120    public void releaseResource() throws DException ;
121
122    /**
123     * This method is required for insertion/updation/deletion through ResultSet.
124     * It helps in constructing a row at the top level of Select Query.
125     * @return mapping of View Table and funciontal columns
126     * @throws DException
127     */

128
129    Object JavaDoc[][] getFunctionalColumnMapping() throws DException;
130
131    /**
132     * This is reqiured when we've to use seek functionality in the case when
133     * permanent index is used. It initializes the number of order columns of
134     * underlying iterator(s). And when seek is called, the array of values whose
135     * length is equals to count maintained, is passed to underlying iterator(s).
136     * @throws DException
137     * @return _OrderCount which represents the Order and number of order columns
138     */

139
140    public _OrderCount getOrderCounts() throws DException ;
141
142    /**
143     * This method is required to obtain the tables on whose record the navigation
144     * is provided by this Iterator.
145     * @return TableDetails representing underlying tables.
146     * @throws DException
147     */

148
149    TableDetails[] getTableDetails() throws DException;
150
151    /**
152     * This method is required for temporary index to maintin uniqueness. Wherever
153     * the temp index is required we add the defaultOrder of that level to the
154     * actual order, so as to maintain the uniquness.
155     * @return _Order
156     * @throws DException
157     */

158    public _Order getDefaultOrder() throws DException;
159
160
161    /* */
162    public void setSpecificUnderlyingReferences(_Reference[] specificUnderlyingReferences) throws DException;
163
164 }
165
166
Popular Tags