Package org.apache.poi.ss.formula
Interface EvaluationWorkbook
-
- All Known Implementing Classes:
EvalBook
,HSSFEvaluationWorkbook
@Internal public interface EvaluationWorkbook
Abstracts a workbook for the purpose of formula evaluation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EvaluationWorkbook.ExternalName
static class
EvaluationWorkbook.ExternalSheet
static class
EvaluationWorkbook.ExternalSheetRange
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
clearAllCachedResultValues()
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 sheetsdefault int
convertLastIndexFromExternSheetIndex(int externSheetIndex)
EvaluationWorkbook.ExternalName
getExternalName(int externSheetIndex, int externNameIndex)
HSSF Only - fetch the external-style name detailsEvaluationWorkbook.ExternalName
getExternalName(String nameName, String sheetName, int externalWorkbookNumber)
XSSF Only - fetch the external-style name detailsEvaluationWorkbook.ExternalSheet
getExternalSheet(int externSheetIndex)
HSSF Only - fetch the external-style sheet detailsEvaluationWorkbook.ExternalSheet
getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber)
XSSF Only - fetch the external-style sheet detailsPtg[]
getFormulaTokens(int sheetIndex, String formula)
Ptg[]
getFormulaTokens(EvaluationCell cell)
EvaluationName
getName(String name, int sheetIndex)
EvaluationName
getName(NamePtg namePtg)
EvaluationSheet
getSheet(int sheetIndex)
Get the sheet identified by the given 0-based index.int
getSheetIndex(String sheetName)
Finds a sheet index by case insensitive name.int
getSheetIndex(EvaluationSheet sheet)
String
getSheetName(int sheetIndex)
Returns the name of the sheet at the given 0-based index.SpreadsheetVersion
getSpreadsheetVersion()
UDFFinder
getUDFFinder()
String
resolveNameXText(NameXPtg ptg)
-
-
-
Method Detail
-
getSheetName
String getSheetName(int sheetIndex)
Returns the name of the sheet at the given 0-based index.- Parameters:
sheetIndex
- The 0-based index of the sheet- Returns:
- The name of the sheet
- Throws:
IllegalArgumentException
- If the index is outside the indices of available sheets
-
getSheetIndex
int getSheetIndex(EvaluationSheet sheet)
- Returns:
- -1 if the specified sheet is from a different book
-
getSheetIndex
int getSheetIndex(String sheetName)
Finds a sheet index by case insensitive name.- Returns:
- the index of the sheet matching the specified name. -1 if not found
-
getSheet
EvaluationSheet getSheet(int sheetIndex)
Get the sheet identified by the given 0-based index.- Parameters:
sheetIndex
- The 0-based index of the sheet- Returns:
- The sheet
- Throws:
IllegalArgumentException
- If the index is outside the indices of available sheets
-
getExternalSheet
EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)
HSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Returns:
- The found sheet or null if not found
- Throws:
IllegalStateException
- If called with XSSF or SXSSF workbooks
-
getExternalSheet
EvaluationWorkbook.ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber)
XSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Returns:
- The found sheet
- Throws:
IllegalStateException
- If called with HSSF workbooks
-
convertFromExternSheetIndex
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
-
convertLastIndexFromExternSheetIndex
default int convertLastIndexFromExternSheetIndex(int externSheetIndex)
-
getExternalName
EvaluationWorkbook.ExternalName getExternalName(int externSheetIndex, int externNameIndex)
HSSF Only - fetch the external-style name details
-
getExternalName
EvaluationWorkbook.ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber)
XSSF Only - fetch the external-style name details
-
getName
EvaluationName getName(NamePtg namePtg)
-
getName
EvaluationName getName(String name, int sheetIndex)
-
getFormulaTokens
Ptg[] getFormulaTokens(EvaluationCell cell)
-
getUDFFinder
UDFFinder getUDFFinder()
-
getSpreadsheetVersion
SpreadsheetVersion getSpreadsheetVersion()
-
clearAllCachedResultValues
void clearAllCachedResultValues()
Propagated fromWorkbookEvaluator.clearAllCachedResultValues()
to clear locally cached data. Implementations must call the same method on all referencedEvaluationSheet
instances, as well as clearing local caches.- Since:
- POI 3.15 beta 3
- See Also:
WorkbookEvaluator.clearAllCachedResultValues()
-
-