1 2 12 package com.versant.core.jdo.query; 13 14 import com.versant.core.common.Debug; 15 16 19 public class MultiplyNode extends Node { 20 21 public static final int OP_TIMES = 0; 22 public static final int OP_DIVIDE = 1; 23 24 28 public int[] ops; 29 30 public MultiplyNode() { 31 } 32 33 public Object accept(NodeVisitor visitor, Object [] results) { 34 return visitor.visitMultiplyNode(this, results); 35 } 36 37 40 public void dump(String indent) { 41 Debug.OUT.println(indent + this); 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_TIMES: return "*"; 55 case OP_DIVIDE: return "/"; 56 } 57 return "Unknown(" + op + ")"; 58 } 59 60 public Field visit(MemVisitor visitor, Object obj) { 61 return visitor.visitMultiplyNode(this, obj); 62 } 63 64 public Object arrive(NodeVisitor v, Object msg) { 65 return v.arriveMultiplyNode(this, msg); 66 } 67 68 } 69 70 | Popular Tags |