Package org.apache.poi.hssf.usermodel
Class HSSFEvaluationWorkbook
java.lang.Object
org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook
- All Implemented Interfaces:
EvaluationWorkbook
,FormulaParsingWorkbook
,FormulaRenderingWorkbook
@Internal
public final class HSSFEvaluationWorkbook
extends Object
implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook
Internal POI use only
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.poi.ss.formula.EvaluationWorkbook
EvaluationWorkbook.ExternalName, EvaluationWorkbook.ExternalSheet, EvaluationWorkbook.ExternalSheetRange
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Propagated fromWorkbookEvaluator.clearAllCachedResultValues()
to clear locally cached data.int
convertFromExternSheetIndex
(int externSheetIndex) HSSF Only - convert an external sheet index to an internal sheet index, for an external-style reference to one of this workbook's own sheetsstatic HSSFEvaluationWorkbook
create
(HSSFWorkbook book) Return the underlying workbookget3DReferencePtg
(AreaReference areaRef, SheetIdentifier sheet) Produce the appropriate Ptg for a 3d area referenceget3DReferencePtg
(CellReference cr, 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 workbookPtg[]
getFormulaTokens
(EvaluationCell evalCell) Lookup a named range by its name.getNameText
(NamePtg namePtg) getNameXPtg
(String name, SheetIdentifier sheet) Return an external name (named range, function, user-defined function) PtggetSheet
(int sheetIndex) getSheetFirstNameByExternSheet
(int externSheetIndex) int
getSheetIndex
(String sheetName) Finds a sheet index by case insensitive name.int
getSheetIndex
(EvaluationSheet evalSheet) 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.)XSSF Only - gets a table that exists in the worksheet
-
Method Details
-
create
-
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:
-
createName
Description copied from interface:FormulaParsingWorkbook
Return the underlying workbook- Specified by:
createName
in interfaceFormulaParsingWorkbook
-
getExternalSheetIndex
Description copied from interface:FormulaParsingWorkbook
gets the externSheet index for a sheet from this workbook- Specified by:
getExternalSheetIndex
in interfaceFormulaParsingWorkbook
-
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
-
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
-
getNameXPtg
Return an external name (named range, function, user-defined function) Ptg- Specified by:
getNameXPtg
in interfaceFormulaParsingWorkbook
-
getName
Lookup a named range by its name.- Specified by:
getName
in interfaceEvaluationWorkbook
- Specified by:
getName
in interfaceFormulaParsingWorkbook
- Parameters:
name
- the name to searchsheetIndex
- the 0-based index of the sheet this formula belongs to. The sheet index is required to resolve sheet-level names.-1
means workbook-global names
-
getSheetIndex
- Specified by:
getSheetIndex
in interfaceEvaluationWorkbook
- Returns:
- -1 if the specified sheet is from a different book
-
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
-
getSheetName
- Specified by:
getSheetName
in interfaceEvaluationWorkbook
-
getSheet
- Specified by:
getSheet
in interfaceEvaluationWorkbook
-
convertFromExternSheetIndex
public int convertFromExternSheetIndex(int externSheetIndex) Description copied from interface:EvaluationWorkbook
HSSF Only - convert an external sheet index to an internal sheet index, for an external-style reference to one of this workbook's own sheets- Specified by:
convertFromExternSheetIndex
in interfaceEvaluationWorkbook
-
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
-
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
-
resolveNameXText
- Specified by:
resolveNameXText
in interfaceEvaluationWorkbook
- Specified by:
resolveNameXText
in interfaceFormulaRenderingWorkbook
-
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
-
getFormulaTokens
- Specified by:
getFormulaTokens
in interfaceEvaluationWorkbook
-
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
-
getTable
Description copied from interface:FormulaParsingWorkbook
XSSF Only - gets a table that exists in the worksheet- Specified by:
getTable
in interfaceFormulaParsingWorkbook
-