1 2 12 package com.versant.core.jdo.query; 13 14 import com.versant.core.common.Debug; 15 16 19 public class AddNode extends Node { 20 21 public static final int OP_PLUS = 0; 22 public static final int OP_MINUS = 1; 23 24 28 public int[] ops; 29 30 public AddNode() { 31 } 32 33 public Object accept(NodeVisitor visitor, Object [] results) { 34 return visitor.visitAddNode(this, results); 35 } 36 37 40 public void dump(String indent) { 41 dumpThis(indent); 42 indent = indent + " "; 43 int i = 0; 44 for (Node c = childList; c != null; c = c.next, i++) { 45 c.dump(indent); 46 if (i < ops.length) { 47 Debug.OUT.println(indent + toOpString(ops[i])); 48 } 49 } 50 } 51 52 public static String toOpString(int op) { 53 switch (op) { 54 case OP_PLUS: return "+"; 55 case OP_MINUS: return "-"; 56 } 57 return "Uknown(" + op + ")"; 58 } 59 60 public Field visit(MemVisitor visitor, Object obj) { 61 return visitor.visitAddNode(this,obj); 62 } 63 64 public Object arrive(NodeVisitor v, Object msg) { 65 return v.arriveAddNode(this, msg); 66 } 67 68 } 69 | Popular Tags |