1 22 23 package org.xquark.extractor.sql; 24 25 26 public class SqlBinOpCompare extends SqlBinaryOperator 27 { 28 29 private static final String RCSRevision = "$Revision: 1.4 $"; 30 private static final String RCSName = "$Name: $"; 31 32 private int _operator; 33 34 40 public SqlBinOpCompare(int operator, SqlExpression leftOperand, SqlExpression rightOperand) 41 { 42 super ( leftOperand, rightOperand ); 43 setOperator ( operator ) ; 44 } 45 46 52 public SqlBinOpCompare() 53 { 54 55 } 56 57 62 public int getOperator() 63 { 64 return _operator; 65 } 66 67 72 public void setOperator(int aOperator) 73 { 74 _operator = aOperator; 75 } 76 77 81 public String toSql(Context context) 82 { 83 StringBuffer retVal = new StringBuffer (); 85 86 retVal.append("("); 87 retVal.append(getLeftOperand().toSql(context)); 88 retVal.append(") "); 89 90 retVal.append(COMPOPSSTRINGS [_operator]); 91 92 retVal.append(" ("); 93 retVal.append(getRightOperand().toSql(context)); 94 retVal.append(")"); 95 96 return retVal.toString(); 98 } 99 } 100 | Popular Tags |