KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > types > Orderable


1 /*
2
3    Derby - Class org.apache.derby.iapi.types.Orderable
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.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
46     /** Ordering operation constant representing '<' **/
47     static final int ORDER_OP_LESSTHAN = 1;
48     /** Ordering operation constant representing '=' **/
49     static final int ORDER_OP_EQUALS = 2;
50     /** Ordering operation constant representing '<=' **/
51     static final int ORDER_OP_LESSOREQUALS = 3;
52
53     /**
54      * These 2 ordering operations are used by the language layer
55      * when flipping the operation due to type precedence rules.
56      * (For example, 1 < 1.1 -> 1.1 > 1)
57      */

58     /** Ordering operation constant representing '>' **/
59     static final int ORDER_OP_GREATERTHAN = 4;
60     /** Ordering operation constant representing '>=' **/
61     static final int ORDER_OP_GREATEROREQUALS = 5;
62
63
64 }
65
Popular Tags