public final class HSSFEvaluationWorkbook extends java.lang.Object implements FormulaRenderingWorkbook, EvaluationWorkbook, FormulaParsingWorkbook
EvaluationWorkbook.ExternalName, EvaluationWorkbook.ExternalSheet
Modifier and Type | Method and Description |
---|---|
int |
convertFromExternSheetIndex(int externSheetIndex) |
int |
convertLastIndexFromExternSheetIndex(int externSheetIndex) |
static HSSFEvaluationWorkbook |
create(HSSFWorkbook book) |
TablePtg |
createTablePtg(java.lang.String tableName,
java.lang.Object[] specifiers,
int sheetIndex,
int rowIdx,
int colIdx) |
java.lang.String |
getBookNameFromExternalLinkIndex(java.lang.String externalLinkIndex)
Return the associated book name of the specified ExternalLink index.
|
java.lang.String |
getExternalLinkIndexFromBookName(java.lang.String bookname) |
EvaluationWorkbook.ExternalName |
getExternalName(int externSheetIndex,
int externNameIndex) |
EvaluationWorkbook.ExternalSheet |
getExternalSheet(int externSheetIndex) |
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) |
Ptg[] |
getFormulaTokens(int sheetIndex,
java.lang.String formula) |
java.lang.String |
getFullNameText(NamePtg namePtg)
Return the full qualified expression.
|
EvaluationName |
getName(NamePtg namePtg) |
EvaluationName |
getName(NamePtg namePtg,
int contextSheetIndex) |
EvaluationName |
getName(java.lang.String name,
int sheetIndex)
Lookup a named range by its name.
|
EvaluationName |
getName(java.lang.String name,
java.lang.String sheetName)
named range name matching is case insensitive
|
java.lang.String |
getNameText(NamePtg namePtg) |
NameXPtg |
getNameXPtg(java.lang.String name) |
EvaluationName |
getOrCreateName(java.lang.String name,
int sheetIndex)
Lookup a named range by its name.
|
EvaluationSheet |
getSheet(int sheetIndex) |
int |
getSheetIndex(EvaluationSheet evalSheet) |
int |
getSheetIndex(java.lang.String sheetName)
Finds a sheet index by case insensitive name.
|
java.lang.String |
getSheetName(int sheetIndex) |
java.lang.String |
getSheetNameByExternSheet(int externSheetIndex) |
SpreadsheetVersion |
getSpreadsheetVersion()
Returns an enum holding spreadhseet properties specific to an Excel version (
max column and row numbers, max arguments to a function, etc.)
|
java.lang.String |
getTableName(java.lang.String name)
Given a name and return the real table name(consider uppercase/lowecase);
It can be used to check whether the specified name is a table name if
the returned name is null.
|
UDFFinder |
getUDFFinder() |
boolean |
isAllowedDeferredNamePtg()
In HSSF, we need to render a formula string from stored Ptg, so a formula cannot be parsed to DeferredNamePtg.
|
java.lang.String |
resolveNameXText(NameXPtg n) |
public static HSSFEvaluationWorkbook create(HSSFWorkbook book)
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 NameXPtg getNameXPtg(java.lang.String name)
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)
getSheetName
in interface EvaluationWorkbook
public EvaluationSheet getSheet(int sheetIndex)
getSheet
in interface EvaluationWorkbook
public int convertFromExternSheetIndex(int externSheetIndex)
convertFromExternSheetIndex
in interface EvaluationWorkbook
public int convertLastIndexFromExternSheetIndex(int externSheetIndex)
convertLastIndexFromExternSheetIndex
in interface EvaluationWorkbook
public EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)
getExternalSheet
in interface EvaluationWorkbook
getExternalSheet
in interface FormulaRenderingWorkbook
null
if externSheetIndex refers to a sheet inside the current workbookpublic EvaluationWorkbook.ExternalName getExternalName(int externSheetIndex, int externNameIndex)
getExternalName
in interface EvaluationWorkbook
public java.lang.String resolveNameXText(NameXPtg n)
resolveNameXText
in interface EvaluationWorkbook
resolveNameXText
in interface FormulaRenderingWorkbook
public java.lang.String getSheetNameByExternSheet(int externSheetIndex)
getSheetNameByExternSheet
in interface FormulaRenderingWorkbook
public java.lang.String getNameText(NamePtg namePtg)
getNameText
in interface FormulaRenderingWorkbook
public EvaluationName getName(NamePtg namePtg)
getName
in interface EvaluationWorkbook
public EvaluationName getName(NamePtg namePtg, int contextSheetIndex)
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 FormulaParsingWorkbook
public java.lang.String getBookNameFromExternalLinkIndex(java.lang.String externalLinkIndex)
FormulaParsingWorkbook
getBookNameFromExternalLinkIndex
in interface FormulaParsingWorkbook
externalLinkIndex
- external link indexpublic EvaluationName getOrCreateName(java.lang.String name, int sheetIndex)
getOrCreateName
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 Ptg[] getFormulaTokens(int sheetIndex, java.lang.String formula)
getFormulaTokens
in interface EvaluationWorkbook
public java.lang.String getExternalLinkIndexFromBookName(java.lang.String bookname)
getExternalLinkIndexFromBookName
in interface FormulaRenderingWorkbook
public boolean isAllowedDeferredNamePtg()
FormulaParsingWorkbook
isAllowedDeferredNamePtg
in interface FormulaParsingWorkbook
public EvaluationName getName(java.lang.String name, java.lang.String sheetName)
FormulaParsingWorkbook
getName
in interface FormulaParsingWorkbook
public java.lang.String getFullNameText(NamePtg namePtg)
FormulaRenderingWorkbook
getFullNameText
in interface FormulaRenderingWorkbook
public TablePtg createTablePtg(java.lang.String tableName, java.lang.Object[] specifiers, int sheetIndex, int rowIdx, int colIdx)
createTablePtg
in interface FormulaParsingWorkbook
public java.lang.String getTableName(java.lang.String name)
FormulaParsingWorkbook
getTableName
in interface FormulaParsingWorkbook
Copyright © 2005-2010 Potix Corporation. All Rights Reserved.