Parses a string formula into a parse tree
| Method from jxl.biff.formula.StringFormulaParser Detail: |
public void adjustRelativeCellReferences(int colAdjust,
int rowAdjust) {
root.adjustRelativeCellReferences(colAdjust, rowAdjust);
}
Default behaviour is to do nothing |
public void columnInserted(int sheetIndex,
int col,
boolean currentSheet) {
root.columnInserted(sheetIndex, col, currentSheet);
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
public void columnRemoved(int sheetIndex,
int col,
boolean currentSheet) {
root.columnRemoved(sheetIndex, col, currentSheet);
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
public byte[] getBytes() {
byte[] bytes = root.getBytes();
if (root.isVolatile())
{
byte[] newBytes = new byte[bytes.length + 4];
System.arraycopy(bytes, 0, newBytes, 4, bytes.length);
newBytes[0] = Token.ATTRIBUTE.getCode();
newBytes[1] = (byte) 0x1;
bytes = newBytes;
}
return bytes;
}
Gets the bytes for the formula |
public String getFormula() {
if (parsedFormula == null)
{
StringBuffer sb = new StringBuffer();
root.getString(sb);
parsedFormula = sb.toString();
}
return parsedFormula;
}
Gets the formula as a string. Uses the parse tree to do this, and
does not simply return whatever string was passed in |
public boolean handleImportedCellReferences() {
root.handleImportedCellReferences();
return root.isValid();
}
If this formula was on an imported sheet, check that
cell references to another sheet are warned appropriately |
public void parse() throws FormulaException {
ArrayList tokens = getTokens();
Iterator i = tokens.iterator();
root = parseCurrent(i);
}
Parses the list of tokens |
public void rowInserted(int sheetIndex,
int row,
boolean currentSheet) {
root.rowInserted(sheetIndex, row, currentSheet);
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |
public void rowRemoved(int sheetIndex,
int row,
boolean currentSheet) {
root.rowRemoved(sheetIndex, row, currentSheet);
}
Called when a column is inserted on the specified sheet. Tells
the formula parser to update all of its cell references beyond this
column |