001 package railo.runtime.sql.exp.op; 002 003 import railo.runtime.sql.exp.Expression; 004 import railo.runtime.sql.exp.ExpressionSupport; 005 006 public class Operation1 extends ExpressionSupport implements Operation { 007 008 private Expression exp; 009 private int operator; 010 011 012 /** 013 * @return the exp 014 */ 015 public Expression getExp() { 016 return exp; 017 } 018 019 /** 020 * @return the operator 021 */ 022 public int getOperator() { 023 return operator; 024 } 025 026 public Operation1(Expression exp, int operator) { 027 this.exp=exp; 028 this.operator=operator; 029 } 030 031 public String toString(boolean noAlias) { 032 if(!hasAlias() || noAlias) { 033 if(operator==OPERATION1_IS_NULL || operator==OPERATION1_IS_NOT_NULL) { 034 return exp.toString(true)+" "+Operation2.toString(operator); 035 } 036 return Operation2.toString(operator)+" "+exp.toString(true); 037 } 038 return toString(true)+" as "+getAlias(); 039 } 040 041 }