01: /*
02:
03: Derby - Class org.apache.derby.iapi.types.Orderable
04:
05: Licensed to the Apache Software Foundation (ASF) under one or more
06: contributor license agreements. See the NOTICE file distributed with
07: this work for additional information regarding copyright ownership.
08: The ASF licenses this file to you under the Apache License, Version 2.0
09: (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.iapi.types;
23:
24: import org.apache.derby.iapi.error.StandardException;
25:
26: /**
27:
28: The Orderable interface represents a value that can
29: be linearly ordered.
30: <P>
31: Currently only supports linear (<, =, <=) operations.
32: Eventually we may want to do other types of orderings,
33: in which case there would probably be a number of interfaces
34: for each "class" of ordering.
35: <P>
36: The implementation must handle the comparison of null
37: values. This may require some changes to the interface,
38: since (at least in some contexts) comparing a value with
39: null should return unknown instead of true or false.
40:
41: **/
42:
43: public interface Orderable {
44:
45: /** Ordering operation constant representing '<' **/
46: static final int ORDER_OP_LESSTHAN = 1;
47: /** Ordering operation constant representing '=' **/
48: static final int ORDER_OP_EQUALS = 2;
49: /** Ordering operation constant representing '<=' **/
50: static final int ORDER_OP_LESSOREQUALS = 3;
51:
52: /**
53: * These 2 ordering operations are used by the language layer
54: * when flipping the operation due to type precedence rules.
55: * (For example, 1 < 1.1 -> 1.1 > 1)
56: */
57: /** Ordering operation constant representing '>' **/
58: static final int ORDER_OP_GREATERTHAN = 4;
59: /** Ordering operation constant representing '>=' **/
60: static final int ORDER_OP_GREATEROREQUALS = 5;
61:
62: }
|