@Internal public final class HSSFEvaluationWorkbook extends java.lang.Object implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook
EvaluationWorkbook.ExternalName, EvaluationWorkbook.ExternalSheet, EvaluationWorkbook.ExternalSheetRange
Modifier and Type | Method and Description |
---|---|
void |
clearAllCachedResultValues()
Propagated from
WorkbookEvaluator.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 sheets
|
static HSSFEvaluationWorkbook |
create(HSSFWorkbook book) |
HSSFName |
createName()
Return the underlying workbook
|
Ptg |
get3DReferencePtg(AreaReference areaRef,
SheetIdentifier sheet)
Produce the appropriate Ptg for a 3d area reference
|
Ptg |
get3DReferencePtg(CellReference cr,
SheetIdentifier sheet)
Produce the appropriate Ptg for a 3d cell reference
|
EvaluationWorkbook.ExternalName |
getExternalName(int externSheetIndex,
int externNameIndex)
HSSF Only - fetch the external-style name details
|
EvaluationWorkbook.ExternalName |
getExternalName(java.lang.String nameName,
java.lang.String sheetName,
int externalWorkbookNumber)
XSSF Only - fetch the external-style name details
|
EvaluationWorkbook.ExternalSheet |
getExternalSheet(int externSheetIndex)
HSSF Only - fetch the external-style sheet details
|
EvaluationWorkbook.ExternalSheet |
getExternalSheet(java.lang.String firstSheetName,
java.lang.String lastSheetName,
int externalWorkbookNumber)
XSSF Only - fetch the external-style sheet details
|
int |
getExternalSheetIndex(java.lang.String sheetName)
gets the externSheet index for a sheet from this workbook
|
int |
getExternalSheetIndex(java.lang.String workbookName,
java.lang.String sheetName)
gets the externSheet index for a sheet from an external workbook
|
Ptg[] |
getFormulaTokens(EvaluationCell evalCell) |
EvaluationName |
getName(NamePtg namePtg) |
EvaluationName |
getName(java.lang.String name,
int sheetIndex)
Lookup a named range by its name.
|
java.lang.String |
getNameText(NamePtg namePtg) |
NameXPtg |
getNameXPtg(java.lang.String name,
SheetIdentifier sheet)
Return an external name (named range, function, user-defined function) Ptg
|
EvaluationSheet |
getSheet(int sheetIndex)
Get the sheet identified by the given 0-based index.
|
java.lang.String |
getSheetFirstNameByExternSheet(int externSheetIndex) |
int |
getSheetIndex(EvaluationSheet evalSheet) |
int |
getSheetIndex(java.lang.String sheetName)
Finds a sheet index by case insensitive name.
|
java.lang.String |
getSheetLastNameByExternSheet(int externSheetIndex) |
java.lang.String |
getSheetName(int sheetIndex)
Returns the name of the sheet at the given 0-based index.
|
SpreadsheetVersion |
getSpreadsheetVersion()
Returns an enum holding spreadhseet properties specific to an Excel version (
max column and row numbers, max arguments to a function, etc.)
|
Table |
getTable(java.lang.String name)
XSSF Only - gets a table that exists in the worksheet
|
UDFFinder |
getUDFFinder() |
java.lang.String |
resolveNameXText(NameXPtg n) |
public static HSSFEvaluationWorkbook create(HSSFWorkbook book)
public void clearAllCachedResultValues()
EvaluationWorkbook
WorkbookEvaluator.clearAllCachedResultValues()
to clear locally cached data.
Implementations must call the same method on all referenced EvaluationSheet
instances, as well as clearing local caches.clearAllCachedResultValues
in interface EvaluationWorkbook
WorkbookEvaluator.clearAllCachedResultValues()
public HSSFName createName()
FormulaParsingWorkbook
createName
in interface FormulaParsingWorkbook
public int getExternalSheetIndex(java.lang.String sheetName)
FormulaParsingWorkbook
getExternalSheetIndex
in interface FormulaParsingWorkbook
public int getExternalSheetIndex(java.lang.String workbookName, java.lang.String sheetName)
FormulaParsingWorkbook
getExternalSheetIndex
in interface FormulaParsingWorkbook
workbookName
- e.g. "Budget.xls"sheetName
- a name of a sheet in that workbookpublic Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet)
FormulaParsingWorkbook
get3DReferencePtg
in interface FormulaParsingWorkbook
public Ptg get3DReferencePtg(AreaReference areaRef, SheetIdentifier sheet)
FormulaParsingWorkbook
get3DReferencePtg
in interface FormulaParsingWorkbook
public NameXPtg getNameXPtg(java.lang.String name, SheetIdentifier sheet)
getNameXPtg
in interface FormulaParsingWorkbook
public EvaluationName getName(java.lang.String name, int sheetIndex)
getName
in interface EvaluationWorkbook
getName
in interface FormulaParsingWorkbook
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 namespublic int getSheetIndex(EvaluationSheet evalSheet)
getSheetIndex
in interface EvaluationWorkbook
public int getSheetIndex(java.lang.String sheetName)
EvaluationWorkbook
getSheetIndex
in interface EvaluationWorkbook
public java.lang.String getSheetName(int sheetIndex)
EvaluationWorkbook
getSheetName
in interface EvaluationWorkbook
sheetIndex
- The 0-based index of the sheetpublic EvaluationSheet getSheet(int sheetIndex)
EvaluationWorkbook
getSheet
in interface EvaluationWorkbook
sheetIndex
- The 0-based index of the sheetpublic int convertFromExternSheetIndex(int externSheetIndex)
EvaluationWorkbook
convertFromExternSheetIndex
in interface EvaluationWorkbook
public EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)
EvaluationWorkbook
Return will have no workbook set if it's actually in our own workbook
getExternalSheet
in interface EvaluationWorkbook
getExternalSheet
in interface FormulaRenderingWorkbook
null
if externSheetIndex refers to a sheet inside the current workbookpublic EvaluationWorkbook.ExternalSheet getExternalSheet(java.lang.String firstSheetName, java.lang.String lastSheetName, int externalWorkbookNumber)
EvaluationWorkbook
Return will have no workbook set if it's actually in our own workbook
getExternalSheet
in interface EvaluationWorkbook
java.lang.IllegalStateException
- XSSF-style external references are not supported for HSSFpublic EvaluationWorkbook.ExternalName getExternalName(int externSheetIndex, int externNameIndex)
EvaluationWorkbook
getExternalName
in interface EvaluationWorkbook
public EvaluationWorkbook.ExternalName getExternalName(java.lang.String nameName, java.lang.String sheetName, int externalWorkbookNumber)
EvaluationWorkbook
getExternalName
in interface EvaluationWorkbook
java.lang.IllegalStateException
- XSSF-style external names are not supported for HSSFpublic java.lang.String resolveNameXText(NameXPtg n)
resolveNameXText
in interface EvaluationWorkbook
resolveNameXText
in interface FormulaRenderingWorkbook
public java.lang.String getSheetFirstNameByExternSheet(int externSheetIndex)
getSheetFirstNameByExternSheet
in interface FormulaRenderingWorkbook
public java.lang.String getSheetLastNameByExternSheet(int externSheetIndex)
getSheetLastNameByExternSheet
in interface FormulaRenderingWorkbook
public java.lang.String getNameText(NamePtg namePtg)
getNameText
in interface FormulaRenderingWorkbook
public EvaluationName getName(NamePtg namePtg)
getName
in interface EvaluationWorkbook
public Ptg[] getFormulaTokens(EvaluationCell evalCell)
getFormulaTokens
in interface EvaluationWorkbook
public UDFFinder getUDFFinder()
getUDFFinder
in interface EvaluationWorkbook
public SpreadsheetVersion getSpreadsheetVersion()
FormulaParsingWorkbook
getSpreadsheetVersion
in interface EvaluationWorkbook
getSpreadsheetVersion
in interface FormulaParsingWorkbook
public Table getTable(java.lang.String name)
FormulaParsingWorkbook
getTable
in interface FormulaParsingWorkbook
java.lang.IllegalStateException
- data tables are not supported in Excel 97-2003 formatCopyright 2022 The Apache Software Foundation or its licensors, as applicable.