@Internal public final class FormulaParser extends java.lang.Object
For POI internal use only
Modifier and Type | Method and Description |
---|---|
static Ptg[] |
parse(java.lang.String formula, FormulaParsingWorkbook workbook, FormulaType formulaType, int sheetIndex)
Parse a formula into an array of tokens Side effect: creates name (
Workbook.createName() ) if formula contains unrecognized names (names are likely UDFs)
(将公式解析为令牌数组副作用:如果公式包含无法识别的名称(名称可能是 UDF),则创建名称 (Workbook.createName()))
|
static Ptg[] |
parse(java.lang.String formula, FormulaParsingWorkbook workbook, FormulaType formulaType, int sheetIndex, int rowIndex)
Parse a formula into an array of tokens Side effect: creates name (
Workbook.createName() ) if formula contains unrecognized names (names are likely UDFs)
(将公式解析为令牌数组副作用:如果公式包含无法识别的名称(名称可能是 UDF),则创建名称 (Workbook.createName()))
|
static Area3DPxg |
parseStructuredReference(java.lang.String tableText, FormulaParsingWorkbook workbook, int rowIndex)
Parse a structured reference.
(解析结构化引用。)
|
public static Ptg[] parse(java.lang.String formula, FormulaParsingWorkbook workbook, FormulaType formulaType, int sheetIndex, int rowIndex)
Workbook.createName()
) if formula contains unrecognized names (names are likely UDFs)
(将公式解析为令牌数组副作用:如果公式包含无法识别的名称(名称可能是 UDF),则创建名称 (Workbook.createName()))
formula
- the formula to parse
(公式 - 要解析的公式)
workbook
- the parent workbook
(工作簿 - 父工作簿)
formulaType
- the type of the 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 names only by name
(sheetIndex - 此公式所属工作表的从 0 开始的索引。需要工作表索引来解析工作表级名称。 -1 表示名称的范围将被忽略,解析器将仅按名称匹配名称)
rowIndex
- - the related cell's row index in 0-based form (-1 if the formula is not cell related) used to handle structured references that have the "#This Row" quantifier. Use rowIndex=-1 or
parseStructuredReference(String, FormulaParsingWorkbook, int)
if formula does not contain structured references.
(rowIndex - - 基于 0 形式的相关单元格的行索引(如果公式与单元格无关,则为 -1),用于处理具有“#This Row”量词的结构化引用。如果公式不包含结构化引用,请使用 rowIndex=-1 或 parseStructuredReference(String, FormulaParsingWorkbook, int)。)
FormulaParseException
- if the formula has incorrect syntax or is otherwise invalid
(FormulaParseException - 如果公式的语法不正确或无效)
public static Ptg[] parse(java.lang.String formula, FormulaParsingWorkbook workbook, FormulaType formulaType, int sheetIndex)
Workbook.createName()
) if formula contains unrecognized names (names are likely UDFs)
(将公式解析为令牌数组副作用:如果公式包含无法识别的名称(名称可能是 UDF),则创建名称 (Workbook.createName()))
formula
- the formula to parse
(公式 - 要解析的公式)
workbook
- the parent workbook
(工作簿 - 父工作簿)
formulaType
- the type of the 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 names only by name
(sheetIndex - 此公式所属工作表的从 0 开始的索引。需要工作表索引来解析工作表级名称。 -1 表示名称的范围将被忽略,解析器将仅按名称匹配名称)
FormulaParseException
- if the formula has incorrect syntax or is otherwise invalid
(FormulaParseException - 如果公式的语法不正确或无效)
public static Area3DPxg parseStructuredReference(java.lang.String tableText, FormulaParsingWorkbook workbook, int rowIndex)
tableText
- - The structured reference text
(tableText - - 结构化的参考文本)
workbook
- - the parent workbook
(工作簿 - - 父工作簿)
rowIndex
- - the 0-based cell's row index ( used to handle "#This Row" quantifiers )
(rowIndex - - 从 0 开始的单元格的行索引(用于处理“#This Row”量词))
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.