1 19 20 package jxl.biff.formula; 21 22 import java.util.Stack ; 23 import jxl.biff.IntegerHelper; 24 25 28 abstract class UnaryOperator extends Operator implements ParsedThing 29 { 30 33 public UnaryOperator() 34 { 35 } 36 37 44 public int read(byte[] data, int pos) 45 { 46 return 0; 47 } 48 49 52 public void getOperands(Stack s) 53 { 54 ParseItem o1 = (ParseItem) s.pop(); 55 56 add(o1); 57 } 58 59 64 public void getString(StringBuffer buf) 65 { 66 ParseItem[] operands = getOperands(); 67 buf.append(getSymbol()); 68 operands[0].getString(buf); 69 } 70 71 78 public void adjustRelativeCellReferences(int colAdjust, int rowAdjust) 79 { 80 ParseItem[] operands = getOperands(); 81 operands[0].adjustRelativeCellReferences(colAdjust, rowAdjust); 82 } 83 84 94 void columnInserted(int sheetIndex, int col, boolean currentSheet) 95 { 96 ParseItem[] operands = getOperands(); 97 operands[0].columnInserted(sheetIndex, col, currentSheet); 98 } 99 100 110 void columnRemoved(int sheetIndex, int col, boolean currentSheet) 111 { 112 ParseItem[] operands = getOperands(); 113 operands[0].columnRemoved(sheetIndex, col, currentSheet); 114 } 115 116 126 void rowInserted(int sheetIndex, int row, boolean currentSheet) 127 { 128 ParseItem[] operands = getOperands(); 129 operands[0].rowInserted(sheetIndex, row, currentSheet); 130 } 131 132 142 void rowRemoved(int sheetIndex, int row, boolean currentSheet) 143 { 144 ParseItem[] operands = getOperands(); 145 operands[0].rowRemoved(sheetIndex, row, currentSheet); 146 } 147 148 153 byte[] getBytes() 154 { 155 ParseItem[] operands = getOperands(); 157 byte[] data = operands[0].getBytes(); 158 159 byte[] newdata = new byte[data.length + 1]; 161 System.arraycopy(data, 0, newdata, 0, data.length); 162 newdata[data.length] = getToken().getCode(); 163 164 return newdata; 165 } 166 167 172 abstract String getSymbol(); 173 174 179 abstract Token getToken(); 180 181 } 182 | Popular Tags |