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 java.lang.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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearAllCachedResultValues()Propagated fromWorkbookEvaluator.clearAllCachedResultValues()to clear locally cached data.intconvertFromExternSheetIndex(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 HSSFEvaluationWorkbookcreate(HSSFWorkbook book)HSSFNamecreateName()Return the underlying workbookPtgget3DReferencePtg(AreaReference areaRef, SheetIdentifier sheet)Produce the appropriate Ptg for a 3d area referencePtgget3DReferencePtg(CellReference cr, SheetIdentifier sheet)Produce the appropriate Ptg for a 3d cell referenceEvaluationWorkbook.ExternalNamegetExternalName(int externSheetIndex, int externNameIndex)HSSF Only - fetch the external-style name detailsEvaluationWorkbook.ExternalNamegetExternalName(java.lang.String nameName, java.lang.String sheetName, int externalWorkbookNumber)XSSF Only - fetch the external-style name detailsEvaluationWorkbook.ExternalSheetgetExternalSheet(int externSheetIndex)HSSF Only - fetch the external-style sheet detailsEvaluationWorkbook.ExternalSheetgetExternalSheet(java.lang.String firstSheetName, java.lang.String lastSheetName, int externalWorkbookNumber)XSSF Only - fetch the external-style sheet detailsintgetExternalSheetIndex(java.lang.String sheetName)gets the externSheet index for a sheet from this workbookintgetExternalSheetIndex(java.lang.String workbookName, java.lang.String sheetName)gets the externSheet index for a sheet from an external workbookPtg[]getFormulaTokens(EvaluationCell evalCell)EvaluationNamegetName(java.lang.String name, int sheetIndex)Lookup a named range by its name.EvaluationNamegetName(NamePtg namePtg)java.lang.StringgetNameText(NamePtg namePtg)NameXPtggetNameXPtg(java.lang.String name, SheetIdentifier sheet)Return an external name (named range, function, user-defined function) PtgEvaluationSheetgetSheet(int sheetIndex)java.lang.StringgetSheetFirstNameByExternSheet(int externSheetIndex)intgetSheetIndex(java.lang.String sheetName)Finds a sheet index by case insensitive name.intgetSheetIndex(EvaluationSheet evalSheet)java.lang.StringgetSheetLastNameByExternSheet(int externSheetIndex)java.lang.StringgetSheetName(int sheetIndex)SpreadsheetVersiongetSpreadsheetVersion()Returns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)TablegetTable(java.lang.String name)XSSF Only - gets a table that exists in the worksheetUDFFindergetUDFFinder()java.lang.StringresolveNameXText(NameXPtg n)
-
-
-
Method Detail
-
create
public static HSSFEvaluationWorkbook create(HSSFWorkbook book)
-
clearAllCachedResultValues
public void clearAllCachedResultValues()
Description copied from interface:EvaluationWorkbookPropagated fromWorkbookEvaluator.clearAllCachedResultValues()to clear locally cached data. Implementations must call the same method on all referencedEvaluationSheetinstances, as well as clearing local caches.- Specified by:
clearAllCachedResultValuesin interfaceEvaluationWorkbook- See Also:
WorkbookEvaluator.clearAllCachedResultValues()
-
createName
public HSSFName createName()
Description copied from interface:FormulaParsingWorkbookReturn the underlying workbook- Specified by:
createNamein interfaceFormulaParsingWorkbook
-
getExternalSheetIndex
public int getExternalSheetIndex(java.lang.String sheetName)
Description copied from interface:FormulaParsingWorkbookgets the externSheet index for a sheet from this workbook- Specified by:
getExternalSheetIndexin interfaceFormulaParsingWorkbook
-
getExternalSheetIndex
public int getExternalSheetIndex(java.lang.String workbookName, java.lang.String sheetName)Description copied from interface:FormulaParsingWorkbookgets the externSheet index for a sheet from an external workbook- Specified by:
getExternalSheetIndexin interfaceFormulaParsingWorkbook- Parameters:
workbookName- e.g. "Budget.xls"sheetName- a name of a sheet in that workbook
-
get3DReferencePtg
public Ptg get3DReferencePtg(CellReference cr, SheetIdentifier sheet)
Description copied from interface:FormulaParsingWorkbookProduce the appropriate Ptg for a 3d cell reference- Specified by:
get3DReferencePtgin interfaceFormulaParsingWorkbook
-
get3DReferencePtg
public Ptg get3DReferencePtg(AreaReference areaRef, SheetIdentifier sheet)
Description copied from interface:FormulaParsingWorkbookProduce the appropriate Ptg for a 3d area reference- Specified by:
get3DReferencePtgin interfaceFormulaParsingWorkbook
-
getNameXPtg
public NameXPtg getNameXPtg(java.lang.String name, SheetIdentifier sheet)
Return an external name (named range, function, user-defined function) Ptg- Specified by:
getNameXPtgin interfaceFormulaParsingWorkbook
-
getName
public EvaluationName getName(java.lang.String name, int sheetIndex)
Lookup a named range by its name.- Specified by:
getNamein interfaceEvaluationWorkbook- Specified by:
getNamein 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.-1means workbook-global names
-
getSheetIndex
public int getSheetIndex(EvaluationSheet evalSheet)
- Specified by:
getSheetIndexin interfaceEvaluationWorkbook- Returns:
- -1 if the specified sheet is from a different book
-
getSheetIndex
public int getSheetIndex(java.lang.String sheetName)
Description copied from interface:EvaluationWorkbookFinds a sheet index by case insensitive name.- Specified by:
getSheetIndexin interfaceEvaluationWorkbook- Returns:
- the index of the sheet matching the specified name. -1 if not found
-
getSheetName
public java.lang.String getSheetName(int sheetIndex)
- Specified by:
getSheetNamein interfaceEvaluationWorkbook
-
getSheet
public EvaluationSheet getSheet(int sheetIndex)
- Specified by:
getSheetin interfaceEvaluationWorkbook
-
convertFromExternSheetIndex
public int convertFromExternSheetIndex(int externSheetIndex)
Description copied from interface:EvaluationWorkbookHSSF 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:
convertFromExternSheetIndexin interfaceEvaluationWorkbook
-
getExternalSheet
public EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)
Description copied from interface:EvaluationWorkbookHSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Specified by:
getExternalSheetin interfaceEvaluationWorkbook- Specified by:
getExternalSheetin interfaceFormulaRenderingWorkbook- Returns:
nullif externSheetIndex refers to a sheet inside the current workbook
-
getExternalSheet
public EvaluationWorkbook.ExternalSheet getExternalSheet(java.lang.String firstSheetName, java.lang.String lastSheetName, int externalWorkbookNumber)
Description copied from interface:EvaluationWorkbookXSSF Only - fetch the external-style sheet detailsReturn will have no workbook set if it's actually in our own workbook
- Specified by:
getExternalSheetin interfaceEvaluationWorkbook
-
getExternalName
public EvaluationWorkbook.ExternalName getExternalName(int externSheetIndex, int externNameIndex)
Description copied from interface:EvaluationWorkbookHSSF Only - fetch the external-style name details- Specified by:
getExternalNamein interfaceEvaluationWorkbook
-
getExternalName
public EvaluationWorkbook.ExternalName getExternalName(java.lang.String nameName, java.lang.String sheetName, int externalWorkbookNumber)
Description copied from interface:EvaluationWorkbookXSSF Only - fetch the external-style name details- Specified by:
getExternalNamein interfaceEvaluationWorkbook
-
resolveNameXText
public java.lang.String resolveNameXText(NameXPtg n)
- Specified by:
resolveNameXTextin interfaceEvaluationWorkbook- Specified by:
resolveNameXTextin interfaceFormulaRenderingWorkbook
-
getSheetFirstNameByExternSheet
public java.lang.String getSheetFirstNameByExternSheet(int externSheetIndex)
- Specified by:
getSheetFirstNameByExternSheetin interfaceFormulaRenderingWorkbook- Returns:
- the name of the (first) sheet referred to by the given external sheet index
-
getSheetLastNameByExternSheet
public java.lang.String getSheetLastNameByExternSheet(int externSheetIndex)
- Specified by:
getSheetLastNameByExternSheetin interfaceFormulaRenderingWorkbook- Returns:
- the name of the (last) sheet referred to by the given external sheet index
-
getNameText
public java.lang.String getNameText(NamePtg namePtg)
- Specified by:
getNameTextin interfaceFormulaRenderingWorkbook
-
getName
public EvaluationName getName(NamePtg namePtg)
- Specified by:
getNamein interfaceEvaluationWorkbook
-
getFormulaTokens
public Ptg[] getFormulaTokens(EvaluationCell evalCell)
- Specified by:
getFormulaTokensin interfaceEvaluationWorkbook
-
getUDFFinder
public UDFFinder getUDFFinder()
- Specified by:
getUDFFinderin interfaceEvaluationWorkbook
-
getSpreadsheetVersion
public SpreadsheetVersion getSpreadsheetVersion()
Description copied from interface:FormulaParsingWorkbookReturns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)- Specified by:
getSpreadsheetVersionin interfaceEvaluationWorkbook- Specified by:
getSpreadsheetVersionin interfaceFormulaParsingWorkbook
-
getTable
public Table getTable(java.lang.String name)
Description copied from interface:FormulaParsingWorkbookXSSF Only - gets a table that exists in the worksheet- Specified by:
getTablein interfaceFormulaParsingWorkbook
-
-