public class ParsingBook extends Object implements FormulaParsingWorkbook, FormulaRenderingWorkbook, Serializable
Constructor and Description |
---|
ParsingBook(SBook book) |
Modifier and Type | Method and Description |
---|---|
TablePtg |
createTablePtg(String tableName,
Object[] specifiers,
int sheetIndex,
int rowIdx,
int colIdx) |
int |
findExternalSheetIndex(String sheetName) |
int |
findExternalSheetIndex(String workbookName,
String sheetName) |
EvaluationWorkbook.ExternalSheet |
getAnyExternalSheet(int externSheetIndex) |
String |
getBookNameFromExternalLinkIndex(String externalLinkIndex)
Return the associated book name of the specified ExternalLink index.
|
String |
getExternalLinkIndexFromBookName(String bookname) |
EvaluationWorkbook.ExternalSheet |
getExternalSheet(int externSheetIndex) |
int |
getExternalSheetIndex(String sheetName)
gets the externSheet index for a sheet from this workbook
|
int |
getExternalSheetIndex(String workbookName,
String sheetName)
gets the externSheet index for a sheet from an external workbook
|
Map<String,Formula> |
getFormulaParsingCache() |
String |
getFullNameText(NamePtg namePtg)
Return the full qualified expression.
|
EvaluationName |
getName(String name,
int sheetIndex)
named range name matching is case insensitive
|
EvaluationName |
getName(String name,
String sheetName)
named range name matching is case insensitive
|
Object[] |
getNameInfo(NamePtg namePtg) |
String |
getNameText(NamePtg namePtg) |
NameXPtg |
getNameXPtg(String name) |
EvaluationName |
getOrCreateName(String name,
int sheetIndex)
named range name matching is case insensitive
|
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.)
|
String |
getTableName(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.
|
boolean |
isAllowedDeferredNamePtg()
In HSSF, we need to render a formula string from stored Ptg, so a formula cannot be parsed to DeferredNamePtg.
|
void |
renameName(int sheetIndex,
String oldName,
String newName) |
void |
renameSheet(String bookName,
String oldName,
String newName)
rename a sheet in this parsing book directly.
|
void |
reorderSheet(String bookName,
int oldIndex,
int newIndex)
reorder a sheet in this parsing book directly.
|
Object[] |
resolveNameXInfo(NameXPtg nameXPtg) |
String |
resolveNameXText(NameXPtg nameXPtg) |
public ParsingBook(SBook book)
public EvaluationName getName(String name, int sheetIndex)
FormulaParsingWorkbook
getName
in interface FormulaParsingWorkbook
public NameXPtg getNameXPtg(String name)
getNameXPtg
in interface FormulaParsingWorkbook
public int getExternalSheetIndex(String sheetName)
FormulaParsingWorkbook
getExternalSheetIndex
in interface FormulaParsingWorkbook
public int getExternalSheetIndex(String workbookName, String sheetName)
FormulaParsingWorkbook
getExternalSheetIndex
in interface FormulaParsingWorkbook
workbookName
- e.g. "Budget.xls"sheetName
- a name of a sheet in that workbookpublic int findExternalSheetIndex(String sheetName)
sheetName
- sheet name or 3D sheet name (e.g "Sheet1:Sheet3")public int findExternalSheetIndex(String workbookName, String sheetName)
workbookName
- book name or nullsheetName
- sheet name or 3D sheet name (e.g "Sheet1:Sheet3")public SpreadsheetVersion getSpreadsheetVersion()
FormulaParsingWorkbook
getSpreadsheetVersion
in interface FormulaParsingWorkbook
public String getBookNameFromExternalLinkIndex(String externalLinkIndex)
FormulaParsingWorkbook
getBookNameFromExternalLinkIndex
in interface FormulaParsingWorkbook
externalLinkIndex
- external link indexpublic EvaluationName getOrCreateName(String name, int sheetIndex)
FormulaParsingWorkbook
getOrCreateName
in interface FormulaParsingWorkbook
public String getNameText(NamePtg namePtg)
getNameText
in interface FormulaRenderingWorkbook
public String getFullNameText(NamePtg namePtg)
FormulaRenderingWorkbook
getFullNameText
in interface FormulaRenderingWorkbook
public String resolveNameXText(NameXPtg nameXPtg)
resolveNameXText
in interface FormulaRenderingWorkbook
public EvaluationWorkbook.ExternalSheet getAnyExternalSheet(int externSheetIndex)
public EvaluationWorkbook.ExternalSheet getExternalSheet(int externSheetIndex)
getExternalSheet
in interface FormulaRenderingWorkbook
null
if externSheetIndex refers to a sheet inside the current workbookpublic String getSheetNameByExternSheet(int externSheetIndex)
getSheetNameByExternSheet
in interface FormulaRenderingWorkbook
public String getExternalLinkIndexFromBookName(String bookname)
getExternalLinkIndexFromBookName
in interface FormulaRenderingWorkbook
public void renameSheet(String bookName, String oldName, String newName)
public boolean isAllowedDeferredNamePtg()
FormulaParsingWorkbook
isAllowedDeferredNamePtg
in interface FormulaParsingWorkbook
public EvaluationName getName(String name, String sheetName)
FormulaParsingWorkbook
getName
in interface FormulaParsingWorkbook
public void reorderSheet(String bookName, int oldIndex, int newIndex)
public TablePtg createTablePtg(String tableName, Object[] specifiers, int sheetIndex, int rowIdx, int colIdx)
createTablePtg
in interface FormulaParsingWorkbook
public String getTableName(String name)
FormulaParsingWorkbook
getTableName
in interface FormulaParsingWorkbook
public Map<String,Formula> getFormulaParsingCache()
getFormulaParsingCache
in interface FormulaParsingWorkbook
Copyright © 2020. All rights reserved.