@Internal public final class HSSFFormulaParser extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static Ptg[] |
parse(java.lang.String formula, HSSFWorkbook workbook)
Convenience method for parsing cell formulas.
(解析单元格公式的便捷方法。)
|
static Ptg[] |
parse(java.lang.String formula, HSSFWorkbook workbook, FormulaType formulaType) |
static Ptg[] |
parse(java.lang.String formula, HSSFWorkbook workbook, FormulaType formulaType, int sheetIndex) |
static java.lang.String |
toFormulaString(HSSFWorkbook book, Ptg[] ptgs)
Static method to convert an array of
Ptg s in RPN order to a human readable string format in infix mode.
(将 RPN 顺序中的 Ptgs 数组转换为中缀模式下人类可读的字符串格式的静态方法。)
|
public static Ptg[] parse(java.lang.String formula, HSSFWorkbook workbook) throws FormulaParseException
parse(String, HSSFWorkbook, FormulaType, int)
(解析单元格公式的便捷方法。参见 parse(String, HSSFWorkbook, FormulaType, int))
formula
- The formula to parse, excluding the leading equals sign
(formula - 要解析的公式,不包括前导等号)
workbook
- The parent workbook
(工作簿 - 父工作簿)
FormulaParseException
- if the formula has incorrect syntax or is otherwise invalid
(FormulaParseException - 如果公式的语法不正确或无效)
public static Ptg[] parse(java.lang.String formula, HSSFWorkbook workbook, FormulaType formulaType) throws FormulaParseException
formula
- The formula to parse, excluding the leading equals sign
(formula - 要解析的公式,不包括前导等号)
workbook
- The parent workbook
(工作簿 - 父工作簿)
formulaType
- The type of formula
(formulaType - 公式的类型)
FormulaParseException
- if the formula has incorrect syntax or is otherwise invalid
(FormulaParseException - 如果公式的语法不正确或无效)
public static Ptg[] parse(java.lang.String formula, HSSFWorkbook workbook, FormulaType formulaType, int sheetIndex) throws FormulaParseException
formula
- The formula to parse
(公式 - 要解析的公式)
workbook
- The parent workbook
(工作簿 - 父工作簿)
formulaType
- The type of formula
(formulaType - 公式的类型)
sheetIndex
- 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 name
(sheetIndex - 此公式所属工作表的从 0 开始的索引。需要工作表索引来解析工作表级名称。 -1 表示名称的范围将被忽略,解析器将仅按名称匹配命名范围)
FormulaParseException
- if the formula has incorrect syntax or is otherwise invalid
(FormulaParseException - 如果公式的语法不正确或无效)
public static java.lang.String toFormulaString(HSSFWorkbook book, Ptg[] ptgs)
Ptg
s in RPN order to a human readable string format in infix mode.
(将 RPN 顺序中的 Ptgs 数组转换为中缀模式下人类可读的字符串格式的静态方法。)
book
- used for defined names and 3D references
(book - 用于定义名称和 3D 参考)
ptgs
- must not be
null
(ptgs - 不能为空)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.