KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > quadcap > sql > types > Op


1 package com.quadcap.sql.types;
2
3 /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
4  *
5  * This software is distributed under the Quadcap Free Software License.
6  * This software may be used or modified for any purpose, personal or
7  * commercial. Open Source redistributions are permitted. Commercial
8  * redistribution of larger works derived from, or works which bundle
9  * this software requires a "Commercial Redistribution License"; see
10  * http://www.quadcap.com/purchase.
11  *
12  * Redistributions qualify as "Open Source" under one of the following terms:
13  *
14  * Redistributions are made at no charge beyond the reasonable cost of
15  * materials and delivery.
16  *
17  * Redistributions are accompanied by a copy of the Source Code or by an
18  * irrevocable offer to provide a copy of the Source Code for up to three
19  * years at the cost of materials and delivery. Such redistributions
20  * must allow further use, modification, and redistribution of the Source
21  * Code under substantially the same terms as this license.
22  *
23  * Redistributions of source code must retain the copyright notices as they
24  * appear in each source code file, these license terms, and the
25  * disclaimer/limitation of liability set forth as paragraph 6 below.
26  *
27  * Redistributions in binary form must reproduce this Copyright Notice,
28  * these license terms, and the disclaimer/limitation of liability set
29  * forth as paragraph 6 below, in the documentation and/or other materials
30  * provided with the distribution.
31  *
32  * The Software is provided on an "AS IS" basis. No warranty is
33  * provided that the Software is free of defects, or fit for a
34  * particular purpose.
35  *
36  * Limitation of Liability. Quadcap Software shall not be liable
37  * for any damages suffered by the Licensee or any third party resulting
38  * from use of the Software.
39  */

40
41 import java.io.IOException JavaDoc;
42
43 import java.util.Enumeration JavaDoc;
44 import java.util.Vector JavaDoc;
45
46 import java.sql.SQLException JavaDoc;
47
48 import com.quadcap.util.Debug;
49
50 /**
51  * A list of all the ops.
52  *
53  * @author Stan Bailes
54  */

55
56 public abstract class Op {
57     public static final int ALL = 1;
58     public static final int AND = 2;
59     public static final int ANY = 3;
60     public static final int BETWEEN = 4;
61     public static final int CONCAT = 5;
62     public static final int CROSS = 6;
63     public static final int DIVIDE = 7;
64     public static final int EQ = 8;
65     public static final int EXCEPT = 9;
66     public static final int EXISTS = 10;
67     public static final int EXP = 11;
68     public static final int FALSE = 12;
69     public static final int FULL = 13;
70     public static final int GE = 14;
71     public static final int GT = 15;
72     public static final int IN = 16;
73     public static final int INNER = 17;
74     public static final int INTERSECT = 18;
75     public static final int LE = 19;
76     public static final int LEFT = 20;
77     public static final int LIKE = 21;
78     public static final int LT = 22;
79     public static final int MINUS = 23;
80     public static final int NE = 24;
81     public static final int NOT = 25;
82     public static final int NULL = 26;
83     public static final int OR = 27;
84     public static final int PLUS = 28;
85     public static final int RIGHT = 29;
86     public static final int COMPARE = 30;
87     public static final int TIMES = 31;
88     public static final int TRUE = 32;
89     public static final int UNION = 33;
90     public static final int UNKNOWN = 34;
91     public static final int PATTERN = 35;
92     public static final int UNIQUE = 36;
93     
94
95     static String JavaDoc[] expStrings = {
96     "<bad op: 0>", "ALL", "AND", "ANY", "BETWEEN", "||", "CROSS", "/", "=",
97     "EXCEPT", "EXISTS", "**", "FALSE", "FULL", ">=", ">", "IN",
98     "INNER", "INTERSECT", "<=", "LEFT", "LIKE", "<", "-", "<>",
99     "NOT", "NULL", "OR", "+", "RIGHT", "COMPARE", "*", "TRUE", "UNION",
100     "UNKNOWN", "PATTERN", "UNIQUE"
101     };
102
103     // this one gets bit or-ed with join types as a modifier
104
public static final int NATURAL = 256;
105
106     public static String JavaDoc toString(int op) {
107     try {
108         return expStrings[op];
109     } catch (Exception JavaDoc e) {
110         return "<bad op: " + op + ">";
111     }
112     }
113 }
114
Popular Tags