1 19 20 package jxl.biff.formula; 21 22 import jxl.Cell; 23 import jxl.WorkbookSettings; 24 import jxl.Workbook; 25 import jxl.biff.WorkbookMethods; 26 27 31 public class FormulaParser 32 { 33 37 private Parser parser; 38 39 49 public FormulaParser(byte[] tokens, Cell rt, ExternalSheet es, 50 WorkbookMethods nt, 51 WorkbookSettings ws) 52 throws FormulaException 53 { 54 if (es.getWorkbookBof() != null && 57 !es.getWorkbookBof().isBiff8()) 58 { 59 throw new FormulaException(FormulaException.biff8Supported); 60 } 61 parser = new TokenFormulaParser(tokens, rt, es, nt, ws); 62 } 63 64 72 public FormulaParser(String form, ExternalSheet es, WorkbookMethods nt, 73 WorkbookSettings ws) 74 { 75 parser = new StringFormulaParser(form, es, nt, ws); 76 } 77 78 79 86 public void adjustRelativeCellReferences(int colAdjust, int rowAdjust) 87 { 88 parser.adjustRelativeCellReferences(colAdjust, rowAdjust); 89 } 90 91 96 public void parse() throws FormulaException 97 { 98 parser.parse(); 99 } 100 101 106 public String getFormula() throws FormulaException 107 { 108 return parser.getFormula(); 109 } 110 111 117 public byte[] getBytes() 118 { 119 return parser.getBytes(); 120 } 121 122 132 public void columnInserted(int sheetIndex, int col, boolean currentSheet) 133 { 134 parser.columnInserted(sheetIndex, col, currentSheet); 135 } 136 137 147 public void columnRemoved(int sheetIndex, int col, boolean currentSheet) 148 { 149 parser.columnRemoved(sheetIndex, col, currentSheet); 150 } 151 152 162 public void rowInserted(int sheetIndex, int row, boolean currentSheet) 163 { 164 parser.rowInserted(sheetIndex, row, currentSheet); 165 } 166 167 177 public void rowRemoved(int sheetIndex, int row, boolean currentSheet) 178 { 179 parser.rowRemoved(sheetIndex, row, currentSheet); 180 } 181 182 } 183 | Popular Tags |