001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.sql.exp.op; 020 021public class OperationUtil { 022 public static String toString(int operator) { 023 switch(operator) { 024 case Operation.OPERATION2_DIVIDE: return "/"; 025 case Operation.OPERATION2_MINUS: return "-"; 026 case Operation.OPERATION2_MULTIPLY: return "*"; 027 case Operation.OPERATION2_PLUS: return "+"; 028 case Operation.OPERATION2_EXP: return "^"; 029 case Operation.OPERATION2_MOD: return "%"; 030 031 case Operation.OPERATION2_AND: return "and"; 032 case Operation.OPERATION2_OR: return "or"; 033 case Operation.OPERATION2_XOR: return "xor"; 034 035 case Operation.OPERATION2_EQ: return "="; 036 case Operation.OPERATION2_GT: return ">"; 037 case Operation.OPERATION2_GTE: return ">="; 038 case Operation.OPERATION2_LT: return "<"; 039 case Operation.OPERATION2_LTE: return "<="; 040 case Operation.OPERATION2_LTGT: return "<>"; 041 case Operation.OPERATION2_NEQ: return "!="; 042 case Operation.OPERATION2_NOT_LIKE: return "not like"; 043 case Operation.OPERATION2_LIKE: return "like"; 044 045 case Operation.OPERATION1_PLUS: return "+"; 046 case Operation.OPERATION1_MINUS: return "-"; 047 case Operation.OPERATION1_NOT: return "not"; 048 case Operation.OPERATION1_IS_NOT_NULL: return "is not null"; 049 case Operation.OPERATION1_IS_NULL: return "is null"; 050 } 051 return null; 052 } 053}