1 19 20 package jxl.biff.formula; 21 22 import java.util.Stack ; 23 import java.util.ArrayList ; 24 25 30 abstract class Operator extends ParseItem 31 { 32 35 private ParseItem[] operands; 36 37 40 public Operator() 41 { 42 operands = new ParseItem[0]; 43 } 44 45 48 protected void setOperandAlternateCode() 49 { 50 for (int i = 0 ; i < operands.length ; i++) 51 { 52 operands[i].setAlternateCode(); 53 } 54 } 55 56 59 protected void add(ParseItem n) 60 { 61 n.setParent(this); 62 63 ParseItem[] newOperands = new ParseItem[operands.length + 1]; 65 System.arraycopy(operands, 0, newOperands, 0, operands.length); 66 newOperands[operands.length] = n; 67 operands = newOperands; 68 } 69 70 73 public abstract void getOperands(Stack s); 74 75 78 protected ParseItem[] getOperands() 79 { 80 return operands; 81 } 82 83 89 abstract int getPrecedence(); 90 91 } 92 | Popular Tags |