1 2 12 package com.versant.core.ejb.query; 13 14 17 public class AddNode extends BinaryNode { 18 19 public static final int ADD = 1; 20 public static final int SUBTRACT = 2; 21 22 private int op; 23 24 public AddNode(Node left, int op, Node right) { 25 super(left, right); 26 this.op = op; 27 } 28 29 public int getOp() { 30 return op; 31 } 32 33 public String getOpStr() { 34 switch (op) { 35 case ADD: return "+"; 36 case SUBTRACT: return "-"; 37 } 38 return "<? op " + op + " ?>"; 39 } 40 41 public Object arrive(NodeVisitor v, Object msg) { 42 return v.arriveAddNode(this, msg); 43 } 44 45 public String toStringImp() { 46 return left + " " + getOpStr() + " " + right; 47 } 48 49 } 50 51 | Popular Tags |