KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > daffodilwoods > daffodildb > server > sql99 > dql > plan > condition > _AllColumnPredicates


1 package com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition;
2
3 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator._Iterator;
4 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.table._IndexPredicateInterface;
5 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition._SingleColumnPredicate;
6 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*;
7 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.predicates.predicate;
8 import com.daffodilwoods.daffodildb.server.sql99.utils.*;
9 import com.daffodilwoods.database.resource.DException;
10 import java.util.*;
11 import com.daffodilwoods.daffodildb.server.datasystem.indexsystem._IndexInformation;
12 import com.daffodilwoods.daffodildb.server.sql99.common.TableDetails;
13
14 /**
15  * It represents all the predicate of same table present in select query.
16  * This is required to distinguish those predicates which can be solved by index
17  * with those which can't be solved by index.
18  * This is also required for index selection for a single table. For a particular
19  * index, some predicate can be solved as index condition and some predicate
20  * will act as non indexed condition.
21  * <p>Title: </p>
22  * <p>Description: </p>
23  * <p>Copyright: Copyright (c) 2003</p>
24  * <p>Company: </p>
25  * @author unascribed
26  * @version 1.0
27  */

28
29 public interface _AllColumnPredicates {
30
31    /**
32     * This method is required to add single predicates which can be solved as
33     * indexed condition.
34     * @param newSingleColumnPredicates
35     * @throws DException
36     */

37
38    public void addSinglePredicate(_SingleColumnPredicate[] newSingleColumnPredicates) throws DException;
39
40    /**
41     * It is required to add those predicates which can't be solved by
42     * index. some cases are 'not predicates', predicates involving more than two
43     * tables etc.
44     * @param newNonIndexedCondition
45     * @throws DException
46     */

47
48    public void addToNonIndex(booleanvalueexpression newNonIndexedCondition) throws DException;
49
50    /**
51     * It is required to get the condition which can't be solved by index.
52     * @return nonIndexed condition
53     * @throws DException
54     */

55
56    public booleanvalueexpression getNonIndexedCondition() throws DException;
57
58    /**
59     * It is required to get condition of different columns of same table which
60     * can be used as index condition.
61     * @return Array of SingleColumnPredicate
62     * @throws DException
63     */

64
65    public _SingleColumnPredicate[] getSingleColumnPredicates() throws DException ;
66
67    /**
68     * This method helps to separate out the predicates which can be solved by
69     * passed index. The predicates are separated out from the list of predicates
70     * which are candidates for indexing use.
71     * @param indexInformation
72     * @param indexPosition
73     * @return
74     * @throws DException
75     */

76
77    public _IndexPredicateInterface splitForIndex(_IndexInformation indexInformation,int indexPosition) throws DException;
78
79    /**
80     * This methods is required to get the resultset based on the condition. This
81     * method is needed after spliting the condition for index. Indexed condition
82     * results in indexed resultset and non indexed condition results in
83     * sequential resultset.
84     * @param sessionObject
85     * @return Iterator
86     * @throws DException
87     */

88
89    public _Iterator execute(Object JavaDoc sessionObject) throws DException;
90
91    /**
92     * This is required to set non indexed condition.
93     * @param nonIndexedCondition
94     */

95
96    public void setNonIndexedCondition(booleanvalueexpression nonIndexedCondition) ;
97
98    /**
99     * It is required to obtain the name of the table.
100     * @return table name
101     * @throws DException
102     */

103
104    public String JavaDoc getTableName() throws DException ;
105 }
106
Popular Tags