public final class HSSFFormulaParser extends Object
FormulaParser and FormulaRenderer| Modifier and Type | Method and Description |
|---|---|
static Ptg[] |
parse(String formula,
HSSFWorkbook workbook)
Convenience method for parsing cell formulas.
|
static Ptg[] |
parse(String formula,
HSSFWorkbook workbook,
int formulaType) |
static Ptg[] |
parse(String formula,
HSSFWorkbook workbook,
int formulaType,
int sheetIndex) |
static String |
toFormulaString(HSSFWorkbook book,
Ptg[] ptgs)
Static method to convert an array of
Ptgs in RPN order
to a human readable string format in infix mode. |
public static Ptg[] parse(String formula, HSSFWorkbook workbook) throws FormulaParseException
parse(String, HSSFWorkbook, int, int)FormulaParseExceptionpublic static Ptg[] parse(String formula, HSSFWorkbook workbook, int formulaType) throws FormulaParseException
formulaType - a constant from FormulaTypeFormulaParseException - if the formula has incorrect syntax or is otherwise invalidpublic static Ptg[] parse(String formula, HSSFWorkbook workbook, int formulaType, int sheetIndex) throws FormulaParseException
formula - the formula to parseworkbook - the parent workbookformulaType - a constant from FormulaTypesheetIndex - the 0-based index of the sheet this formula belongs to.
The sheet index is required to resolve sheet-level names. -1 means that
the scope of the name will be ignored and the parser will match named ranges only by nameFormulaParseException - if the formula has incorrect syntax or is otherwise invalidpublic static String toFormulaString(HSSFWorkbook book, Ptg[] ptgs)
Ptgs in RPN order
to a human readable string format in infix mode.book - used for defined names and 3D referencesptgs - must not be nullCopyright © 2020. All rights reserved.