1 2 12 package com.versant.core.ejb.query; 13 14 17 public class CompNode extends BinaryNode { 18 19 public static final int EQ = 1; public static final int GT = 2; public static final int GE = 3; public static final int LT = 4; public static final int LE = 5; public static final int NE = 6; 26 private int op; 27 28 public CompNode(Node left, int op, Node right) { 29 super(left, right); 30 this.op = op; 31 } 32 33 public int getOp() { 34 return op; 35 } 36 37 public String getOpStr() { 38 switch (op) { 39 case EQ: return "="; 40 case GT: return ">"; 41 case GE: return ">="; 42 case LT: return "<"; 43 case LE: return "<="; 44 case NE: return "<>"; 45 } 46 return "<? op " + op + " ?>"; 47 } 48 49 public Object arrive(NodeVisitor v, Object msg) { 50 return v.arriveCompNode(this, msg); 51 } 52 53 public String toStringImp() { 54 StringBuffer s = new StringBuffer (); 55 s.append(left); 56 s.append(' '); 57 s.append(getOpStr()); 58 s.append(' '); 59 s.append(right); 60 return s.toString(); 61 } 62 63 } 64 65 | Popular Tags |