Package org.apache.poi.xssf.usermodel
Class BaseXSSFEvaluationWorkbook
java.lang.Object
org.apache.poi.xssf.usermodel.BaseXSSFEvaluationWorkbook
- All Implemented Interfaces:
EvaluationWorkbook
,FormulaParsingWorkbook
,FormulaRenderingWorkbook
- Direct Known Subclasses:
SXSSFEvaluationWorkbook
,XSSFEvaluationWorkbook
@Internal
public abstract class BaseXSSFEvaluationWorkbook
extends Object
implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook
Internal POI use only - parent of XSSF and SXSSF evaluation workbooks
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.ss.formula.EvaluationWorkbook
EvaluationWorkbook.ExternalName, EvaluationWorkbook.ExternalSheet, EvaluationWorkbook.ExternalSheetRange
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Propagated fromWorkbookEvaluator.clearAllCachedResultValues()
to clear locally cached data.int
convertFromExternSheetIndex
(int externSheetIndex) XSSF doesn't use external sheet indexes, so when asked treat it just as a local indexReturn the underlying workbookget3DReferencePtg
(AreaReference area, SheetIdentifier sheet) Produce the appropriate Ptg for a 3d area referenceget3DReferencePtg
(CellReference cell, SheetIdentifier sheet) Produce the appropriate Ptg for a 3d cell referencegetExternalName
(int externSheetIndex, int externNameIndex) HSSF Only - fetch the external-style name detailsgetExternalName
(String nameName, String sheetName, int externalWorkbookNumber) XSSF Only - fetch the external-style name detailsgetExternalSheet
(int externSheetIndex) HSSF Only - fetch the external-style sheet detailsgetExternalSheet
(String firstSheetName, String lastSheetName, int externalWorkbookNumber) XSSF Only - fetch the external-style sheet detailsint
getExternalSheetIndex
(String sheetName) gets the externSheet index for a sheet from this workbookint
getExternalSheetIndex
(String workbookName, String sheetName) gets the externSheet index for a sheet from an external workbookReturn EvaluationName wrapper around the matching XSSFName (named range)getNameText
(NamePtg namePtg) getNameXPtg
(String name, SheetIdentifier sheet) Return an external name (named range, function, user-defined function) PxggetSheetFirstNameByExternSheet
(int externSheetIndex) int
getSheetIndex
(String sheetName) Finds a sheet index by case insensitive name.getSheetLastNameByExternSheet
(int externSheetIndex) getSheetName
(int sheetIndex) Returns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)Returns the data table with the given name (case insensitive).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.poi.ss.formula.EvaluationWorkbook
getFormulaTokens, getSheet, getSheetIndex
-
Field Details
-
_uBook
-
-
Constructor Details
-
BaseXSSFEvaluationWorkbook
-
-
Method Details
-
clearAllCachedResultValues
public void clearAllCachedResultValues()Description copied from interface:EvaluationWorkbook
Propagated fromWorkbookEvaluator.clearAllCachedResultValues()
to clear locally cached data. Implementations must call the same method on all referencedEvaluationSheet
instances, as well as clearing local caches.- Specified by:
clearAllCachedResultValues
in interfaceEvaluationWorkbook
- See Also:
-
convertFromExternSheetIndex
public int convertFromExternSheetIndex(int externSheetIndex) XSSF doesn't use external sheet indexes, so when asked treat it just as a local index- Specified by:
convertFromExternSheetIndex
in interfaceEvaluationWorkbook
-
getExternalSheetIndex
Description copied from interface:FormulaParsingWorkbook
gets the externSheet index for a sheet from this workbook- Specified by:
getExternalSheetIndex
in interfaceFormulaParsingWorkbook
-
getName
Return EvaluationName wrapper around the matching XSSFName (named range)- Specified by:
getName
in interfaceEvaluationWorkbook
- Specified by:
getName
in interfaceFormulaParsingWorkbook
- Parameters:
name
- case-aware but case-insensitive named range in workbooksheetIndex
- index of sheet if named range scope is limited to one sheet if named range scope is global to the workbook, sheetIndex is -1.- Returns:
- If name is a named range in the workbook, returns EvaluationName corresponding to that named range Returns null if there is no named range with the same name and scope in the workbook
-
getSheetName
- Specified by:
getSheetName
in interfaceEvaluationWorkbook
-
getExternalName
Description copied from interface:EvaluationWorkbook
HSSF Only - fetch the external-style name details- Specified by:
getExternalName
in interfaceEvaluationWorkbook
-
getExternalName
public EvaluationWorkbook.ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber) Description copied from interface:EvaluationWorkbook
XSSF Only - fetch the external-style name details- Specified by:
getExternalName
in interfaceEvaluationWorkbook
-
getNameXPtg
Return an external name (named range, function, user-defined function) Pxg- Specified by:
getNameXPtg
in interfaceFormulaParsingWorkbook
-
get3DReferencePtg
Description copied from interface:FormulaParsingWorkbook
Produce the appropriate Ptg for a 3d cell reference- Specified by:
get3DReferencePtg
in interfaceFormulaParsingWorkbook
-
get3DReferencePtg
Description copied from interface:FormulaParsingWorkbook
Produce the appropriate Ptg for a 3d area reference- Specified by:
get3DReferencePtg
in interfaceFormulaParsingWorkbook
-
resolveNameXText
- Specified by:
resolveNameXText
in interfaceEvaluationWorkbook
- Specified by:
resolveNameXText
in interfaceFormulaRenderingWorkbook
-
getExternalSheet
Description copied from interface:EvaluationWorkbook
HSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Specified by:
getExternalSheet
in interfaceEvaluationWorkbook
- Specified by:
getExternalSheet
in interfaceFormulaRenderingWorkbook
- Returns:
null
if externSheetIndex refers to a sheet inside the current workbook
-
getExternalSheet
public EvaluationWorkbook.ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber) Description copied from interface:EvaluationWorkbook
XSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Specified by:
getExternalSheet
in interfaceEvaluationWorkbook
-
getExternalSheetIndex
Description copied from interface:FormulaParsingWorkbook
gets the externSheet index for a sheet from an external workbook- Specified by:
getExternalSheetIndex
in interfaceFormulaParsingWorkbook
- Parameters:
workbookName
- e.g. "Budget.xls"sheetName
- a name of a sheet in that workbook
-
getSheetIndex
Description copied from interface:EvaluationWorkbook
Finds a sheet index by case insensitive name.- Specified by:
getSheetIndex
in interfaceEvaluationWorkbook
- Returns:
- the index of the sheet matching the specified name. -1 if not found
-
getSheetFirstNameByExternSheet
- Specified by:
getSheetFirstNameByExternSheet
in interfaceFormulaRenderingWorkbook
- Returns:
- the name of the (first) sheet referred to by the given external sheet index
-
getSheetLastNameByExternSheet
- Specified by:
getSheetLastNameByExternSheet
in interfaceFormulaRenderingWorkbook
- Returns:
- the name of the (last) sheet referred to by the given external sheet index
-
getNameText
- Specified by:
getNameText
in interfaceFormulaRenderingWorkbook
-
getName
- Specified by:
getName
in interfaceEvaluationWorkbook
-
createName
Description copied from interface:FormulaParsingWorkbook
Return the underlying workbook- Specified by:
createName
in interfaceFormulaParsingWorkbook
-
getTable
Returns the data table with the given name (case insensitive). Tables are cached for performance (formula evaluation looks them up by name repeatedly). After the first table lookup, adding or removing a table from the document structure will cause trouble. This is meant to be used on documents whose structure is essentially static at the point formulas are evaluated.- Specified by:
getTable
in interfaceFormulaParsingWorkbook
- Parameters:
name
- the data table name (case-insensitive)- Returns:
- The Data table in the workbook named name, or null if no table is named name.
- Since:
- 3.15 beta 2
-
getUDFFinder
- Specified by:
getUDFFinder
in interfaceEvaluationWorkbook
-
getSpreadsheetVersion
Description copied from interface:FormulaParsingWorkbook
Returns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)- Specified by:
getSpreadsheetVersion
in interfaceEvaluationWorkbook
- Specified by:
getSpreadsheetVersion
in interfaceFormulaParsingWorkbook
-