Top Description Inners Methods
org.apache.poi.ss.formula

public Interface EvaluationWorkbook

Known Direct Implementers
org.apache.poi.ss.formula.eval.forked.ForkedEvaluationWorkbook, org.apache.poi.hssf.usermodel.HSSFEvaluationWorkbook
Annotations
@Internal
Imports
org.apache.poi.ss.SpreadsheetVersion, org.apache.poi.ss.formula.ptg.NamePtg, .NameXPtg, .Ptg, org.apache.poi.ss.formula.udf.UDFFinder, org.apache.poi.util.Internal

Abstracts a workbook for the purpose of formula evaluation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class

Method Summary

Modifier and TypeMethod and Description
public void
clearAllCachedResultValues()

Propagated from WorkbookEvaluator#clearAllCachedResultValues() to clear locally cached data.

public 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

public EvaluationWorkbook.ExternalName
getExternalName(int externSheetIndex, int externNameIndex)

HSSF Only - fetch the external-style name details

public EvaluationWorkbook.ExternalName
getExternalName(String nameName, String sheetName, int externalWorkbookNumber)

XSSF Only - fetch the external-style name details

public EvaluationWorkbook.ExternalSheet

Returns:

The found sheet or null if not found
getExternalSheet
(int externSheetIndex)

HSSF Only - fetch the external-style sheet details

Return will have no workbook set if it's actually in our own workbook

public EvaluationWorkbook.ExternalSheet

Returns:

The found sheet
getExternalSheet
(String firstSheetName, String lastSheetName, int externalWorkbookNumber)

XSSF Only - fetch the external-style sheet details

Return will have no workbook set if it's actually in our own workbook

public Ptg[]
public EvaluationName
getName(NamePtg namePtg)

public EvaluationName
getName(String name, int sheetIndex)

public EvaluationSheet

Returns:

The sheet
getSheet
(int
The 0-based index of the sheet
sheetIndex
)

Get the sheet identified by the given 0-based index.

public int

Returns:

-1 if the specified sheet is from a different book
getSheetIndex
(EvaluationSheet sheet)

public int

Returns:

the index of the sheet matching the specified name. -1 if not found
getSheetIndex
(String sheetName)

Finds a sheet index by case insensitive name.

public String

Returns:

The name of the sheet
getSheetName
(int
The 0-based index of the sheet
sheetIndex
)

Returns the name of the sheet at the given 0-based index.

public SpreadsheetVersion
public UDFFinder
public String

Method Detail

clearAllCachedResultValuesback to summary
public void clearAllCachedResultValues()

Propagated from WorkbookEvaluator#clearAllCachedResultValues() to clear locally cached data. Implementations must call the same method on all referenced EvaluationSheet instances, as well as clearing local caches.

Since
POI 3.15 beta 3
See Also
WorkbookEvaluator#clearAllCachedResultValues()
convertFromExternSheetIndexback to summary
public 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

getExternalNameback to summary
public EvaluationWorkbook.ExternalName getExternalName(int externSheetIndex, int externNameIndex)

HSSF Only - fetch the external-style name details

getExternalNameback to summary
public EvaluationWorkbook.ExternalName getExternalName(String nameName, String sheetName, int externalWorkbookNumber)

XSSF Only - fetch the external-style name details

getExternalSheetback to summary
public EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)

HSSF Only - fetch the external-style sheet details

Return will have no workbook set if it's actually in our own workbook

Returns:EvaluationWorkbook.ExternalSheet

The found sheet or null if not found

Exceptions
IllegalStateException:
If called with XSSF or SXSSF workbooks
getExternalSheetback to summary
public EvaluationWorkbook.ExternalSheet getExternalSheet(String firstSheetName, String lastSheetName, int externalWorkbookNumber)

XSSF Only - fetch the external-style sheet details

Return will have no workbook set if it's actually in our own workbook

Returns:EvaluationWorkbook.ExternalSheet

The found sheet

Exceptions
IllegalStateException:
If called with HSSF workbooks
getFormulaTokensback to summary
public Ptg[] getFormulaTokens(EvaluationCell cell)
getNameback to summary
public EvaluationName getName(NamePtg namePtg)
getNameback to summary
public EvaluationName getName(String name, int sheetIndex)
getSheetback to summary
public EvaluationSheet getSheet(int sheetIndex)

Get the sheet identified by the given 0-based index.

Parameters
sheetIndex:int

The 0-based index of the sheet

Returns:EvaluationSheet

The sheet

Exceptions
IllegalArgumentException:
If the index is outside the indices of available sheets
getSheetIndexback to summary
public int getSheetIndex(EvaluationSheet sheet)
Returns:int

-1 if the specified sheet is from a different book

getSheetIndexback to summary
public int getSheetIndex(String sheetName)

Finds a sheet index by case insensitive name.

Returns:int

the index of the sheet matching the specified name. -1 if not found

getSheetNameback to summary
public String getSheetName(int sheetIndex)

Returns the name of the sheet at the given 0-based index.

Parameters
sheetIndex:int

The 0-based index of the sheet

Returns:String

The name of the sheet

Exceptions
IllegalArgumentException:
If the index is outside the indices of available sheets
getSpreadsheetVersionback to summary
public SpreadsheetVersion getSpreadsheetVersion()
getUDFFinderback to summary
public UDFFinder getUDFFinder()
resolveNameXTextback to summary
public String resolveNameXText(NameXPtg ptg)
org.apache.poi.ss.formula back to summary

public Class EvaluationWorkbook.ExternalName

extends Object
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final int
private final String
private final int

Constructor Summary

AccessConstructor and Description
public
ExternalName(String nameName, int nameNumber, int ix)

Method Summary

Modifier and TypeMethod and Description
public int
public String
public int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_ixback to summary
private final int _ix
_nameNameback to summary
private final String _nameName
_nameNumberback to summary
private final int _nameNumber

Constructor Detail

ExternalNameback to summary
public ExternalName(String nameName, int nameNumber, int ix)

Method Detail

getIxback to summary
public int getIx()
getNameback to summary
public String getName()
getNumberback to summary
public int getNumber()
org.apache.poi.ss.formula back to summary

public Class EvaluationWorkbook.ExternalSheet

extends Object
Class Inheritance
Known Direct Subclasses
org.apache.poi.ss.formula.EvaluationWorkbook.ExternalSheetRange

Field Summary

Modifier and TypeField and Description
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
ExternalSheet(String workbookName, String sheetName)

Method Summary

Modifier and TypeMethod and Description
public String
public String
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_sheetNameback to summary
private final String _sheetName
_workbookNameback to summary
private final String _workbookName

Constructor Detail

ExternalSheetback to summary
public ExternalSheet(String workbookName, String sheetName)

Method Detail

getSheetNameback to summary
public String getSheetName()
getWorkbookNameback to summary
public String getWorkbookName()
org.apache.poi.ss.formula back to summary

public Class EvaluationWorkbook.ExternalSheetRange

extends ExternalSheet
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
public
ExternalSheetRange(String workbookName, String firstSheetName, String lastSheetName)

Method Summary

Modifier and TypeMethod and Description
public String
public String
Inherited from org.apache.poi.ss.formula.EvaluationWorkbook.ExternalSheet:
getSheetNamegetWorkbookName

Field Detail

_lastSheetNameback to summary
private final String _lastSheetName

Constructor Detail

ExternalSheetRangeback to summary
public ExternalSheetRange(String workbookName, String firstSheetName, String lastSheetName)

Method Detail

getFirstSheetNameback to summary
public String getFirstSheetName()
getLastSheetNameback to summary
public String getLastSheetName()