KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > store > access > UTFQualifier


1 /*
2
3    Derby - Class org.apache.derby.impl.store.access.UTFQualifier
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.impl.store.access;
23
24 import org.apache.derby.iapi.types.DataValueDescriptor;
25
26 import org.apache.derby.iapi.store.access.Qualifier;
27
28 /**
29 */

30 public class UTFQualifier implements Qualifier
31 {
32     private UTF value;
33     private int columnId;
34
35     public UTFQualifier(int columnId, String JavaDoc value) {
36
37         this.columnId = columnId;
38         this.value = new UTF(value);
39     }
40
41     /*
42     ** Qualifier interface
43     */

44
45     /** Get the id of the column to be qualified. **/
46     public int getColumnId() {
47         return columnId;
48     }
49
50     /**
51      * Get the value that the column is to be compared to.
52      *
53      * @exception StandardException Thrown on error
54      */

55     public DataValueDescriptor getOrderable() {
56         return value;
57     }
58
59     /** Get the operator to use in the comparison.
60      *
61      * @see DataValueDescriptor#compare
62      **/

63     public int getOperator() {
64         return DataValueDescriptor.ORDER_OP_EQUALS;
65
66     }
67
68     /**
69      * Determine if the result from the compare operation is to be negated.
70      * <p>
71      * If true then only rows which fail the compare operation will qualify.
72      *
73      * @see DataValueDescriptor#compare
74      **/

75     public boolean negateCompareResult() {
76         return false;
77     }
78
79     /**
80      *
81      * @see Qualifier#getOrderedNulls
82      **/

83     public boolean getOrderedNulls() {
84         return false;
85     }
86
87     /** Get the getOrderedNulls argument to use in the comparison.
88      *
89      * @see DataValueDescriptor#compare
90      **/

91     public boolean getUnknownRV() {
92         return false;
93     }
94
95     /** Clear the DataValueDescriptor cache, if one exists.
96      * (The DataValueDescriptor can be 1 of 3 types:
97      * o VARIANT - cannot be cached as its value can
98      * vary within a scan
99      * o SCAN_INVARIANT - can be cached within a scan as its
100      * value will not change within a scan
101      * o QUERY_INVARIANT- can be cached across the life of the query
102      * as its value will never change
103      * o CONSTANT - can be cached across executions
104      *
105      * @see Qualifier#getUnknownRV
106      */

107     public void clearOrderableCache()
108     {
109     }
110
111     /**
112      * This method reinitializes all the state of
113      * the Qualifier. It is used to distinguish between
114      * resetting something that is query invariant
115      * and something that is constant over every
116      * execution of a query. Basically, clearOrderableCache()
117      * will only clear out its cache if it is a VARIANT
118      * or SCAN_INVARIANT value. However, each time a
119      * query is executed, the QUERY_INVARIANT qualifiers need
120      * to be reset.
121      */

122     public void reinitialize()
123     {
124     }
125 }
126
Popular Tags