001: package com.quadcap.sql.types;
002:
003: /* Copyright 1999 - 2003 Quadcap Software. All rights reserved.
004: *
005: * This software is distributed under the Quadcap Free Software License.
006: * This software may be used or modified for any purpose, personal or
007: * commercial. Open Source redistributions are permitted. Commercial
008: * redistribution of larger works derived from, or works which bundle
009: * this software requires a "Commercial Redistribution License"; see
010: * http://www.quadcap.com/purchase.
011: *
012: * Redistributions qualify as "Open Source" under one of the following terms:
013: *
014: * Redistributions are made at no charge beyond the reasonable cost of
015: * materials and delivery.
016: *
017: * Redistributions are accompanied by a copy of the Source Code or by an
018: * irrevocable offer to provide a copy of the Source Code for up to three
019: * years at the cost of materials and delivery. Such redistributions
020: * must allow further use, modification, and redistribution of the Source
021: * Code under substantially the same terms as this license.
022: *
023: * Redistributions of source code must retain the copyright notices as they
024: * appear in each source code file, these license terms, and the
025: * disclaimer/limitation of liability set forth as paragraph 6 below.
026: *
027: * Redistributions in binary form must reproduce this Copyright Notice,
028: * these license terms, and the disclaimer/limitation of liability set
029: * forth as paragraph 6 below, in the documentation and/or other materials
030: * provided with the distribution.
031: *
032: * The Software is provided on an "AS IS" basis. No warranty is
033: * provided that the Software is free of defects, or fit for a
034: * particular purpose.
035: *
036: * Limitation of Liability. Quadcap Software shall not be liable
037: * for any damages suffered by the Licensee or any third party resulting
038: * from use of the Software.
039: */
040:
041: import java.io.IOException;
042:
043: import java.util.Enumeration;
044: import java.util.Vector;
045:
046: import java.sql.SQLException;
047:
048: import com.quadcap.util.Debug;
049:
050: /**
051: * A list of all the ops.
052: *
053: * @author Stan Bailes
054: */
055:
056: public abstract class Op {
057: public static final int ALL = 1;
058: public static final int AND = 2;
059: public static final int ANY = 3;
060: public static final int BETWEEN = 4;
061: public static final int CONCAT = 5;
062: public static final int CROSS = 6;
063: public static final int DIVIDE = 7;
064: public static final int EQ = 8;
065: public static final int EXCEPT = 9;
066: public static final int EXISTS = 10;
067: public static final int EXP = 11;
068: public static final int FALSE = 12;
069: public static final int FULL = 13;
070: public static final int GE = 14;
071: public static final int GT = 15;
072: public static final int IN = 16;
073: public static final int INNER = 17;
074: public static final int INTERSECT = 18;
075: public static final int LE = 19;
076: public static final int LEFT = 20;
077: public static final int LIKE = 21;
078: public static final int LT = 22;
079: public static final int MINUS = 23;
080: public static final int NE = 24;
081: public static final int NOT = 25;
082: public static final int NULL = 26;
083: public static final int OR = 27;
084: public static final int PLUS = 28;
085: public static final int RIGHT = 29;
086: public static final int COMPARE = 30;
087: public static final int TIMES = 31;
088: public static final int TRUE = 32;
089: public static final int UNION = 33;
090: public static final int UNKNOWN = 34;
091: public static final int PATTERN = 35;
092: public static final int UNIQUE = 36;
093:
094: static String[] expStrings = { "<bad op: 0>", "ALL", "AND", "ANY",
095: "BETWEEN", "||", "CROSS", "/", "=", "EXCEPT", "EXISTS",
096: "**", "FALSE", "FULL", ">=", ">", "IN", "INNER",
097: "INTERSECT", "<=", "LEFT", "LIKE", "<", "-", "<>", "NOT",
098: "NULL", "OR", "+", "RIGHT", "COMPARE", "*", "TRUE",
099: "UNION", "UNKNOWN", "PATTERN", "UNIQUE" };
100:
101: // this one gets bit or-ed with join types as a modifier
102: public static final int NATURAL = 256;
103:
104: public static String toString(int op) {
105: try {
106: return expStrings[op];
107: } catch (Exception e) {
108: return "<bad op: " + op + ">";
109: }
110: }
111: }
|