01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: /*
17: * $Id: Operators.java,v 1.6 2004/12/15 17:35:46 jycli Exp $
18: */
19:
20: package org.apache.xalan.xsltc.runtime;
21:
22: /**
23: * @author Jacek Ambroziak
24: * @author Santiago Pericas-Geertsen
25: */
26: public final class Operators {
27: public static final int EQ = 0;
28: public static final int NE = 1;
29: public static final int GT = 2;
30: public static final int LT = 3;
31: public static final int GE = 4;
32: public static final int LE = 5;
33:
34: private static final String[] names = { "=", "!=", ">", "<", ">=",
35: "<=" };
36:
37: public static final String getOpNames(int operator) {
38: return names[operator];
39: }
40:
41: // Swap operator array
42: private static final int[] swapOpArray = { EQ, // EQ
43: NE, // NE
44: LT, // GT
45: GT, // LT
46: LE, // GE
47: GE // LE
48: };
49:
50: public static final int swapOp(int operator) {
51: return swapOpArray[operator];
52: }
53:
54: }
|