Interface FormulaParsingWorkbook

  • All Known Implementing Classes:
    HSSFEvaluationWorkbook

    public interface FormulaParsingWorkbook
    Abstracts a workbook for the purpose of formula parsing.
    For POI internal use only
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Name createName()
      Return the underlying workbook
      TablePtg createTablePtg​(java.lang.String tableName, java.lang.Object[] specifiers, int sheetIndex, int rowIdx, int colIdx)  
      Ptg get3DReferencePtg​(AreaReference area, SheetIdentifier sheet)
      Produce the appropriate Ptg for a 3d area reference
      Ptg get3DReferencePtg​(CellReference cell, SheetIdentifier sheet)
      Produce the appropriate Ptg for a 3d cell reference
      java.lang.String getBookNameFromExternalLinkIndex​(java.lang.String externalLinkIndex)
      Return the associated book name of the specified ExternalLink index.
      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
      EvaluationName getName​(java.lang.String name, int sheetIndex)
      named range name matching is case insensitive
      EvaluationName getName​(java.lang.String name, java.lang.String sheetName)
      named range name matching is case-insensitive
      Ptg getNameXPtg​(java.lang.String name, SheetIdentifier sheet)
      Return an external name (named range, function, user-defined function) Ptg
      SpreadsheetVersion getSpreadsheetVersion()
      Returns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)
      Table getTable​(java.lang.String name)
      XSSF Only - gets a table that exists in the worksheet
      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.
      boolean isAllowedDeferredNamePtg()
      In HSSF, we need to render a formula string from stored Ptg, so a formula cannot be parsed to DeferredNamePtg.
    • Method Detail

      • getName

        EvaluationName getName​(java.lang.String name,
                               int sheetIndex)
        named range name matching is case insensitive
      • isAllowedDeferredNamePtg

        boolean isAllowedDeferredNamePtg()
        In HSSF, we need to render a formula string from stored Ptg, so a formula cannot be parsed to DeferredNamePtg. Because DeferredNamePtg will be read as UnknownPtg for it's not written out.
        Returns:
        true for using DeferredNamePtg to represent a non-existed defined name during formula parsing. If false, parser will create a defined name for a non-existed one.
      • getBookNameFromExternalLinkIndex

        java.lang.String getBookNameFromExternalLinkIndex​(java.lang.String externalLinkIndex)
        Return the associated book name of the specified ExternalLink index. Excel stores ExternalLink index in place of the [].(e.g. [1]Sheet1:Sheet3!xxx)
        Parameters:
        externalLinkIndex - external link index
        Returns:
        the associated book name of the specified ExternalLink index.
      • createTablePtg

        TablePtg createTablePtg​(java.lang.String tableName,
                                java.lang.Object[] specifiers,
                                int sheetIndex,
                                int rowIdx,
                                int colIdx)
        Parameters:
        tableName -
        specifiers -
        sheetIndex -
        rowIdx -
        colIdx -
        Returns:
        Since:
        3.9.7, 3.9.7
      • getTableName

        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.
        Parameters:
        name -
        Returns:
        Since:
        3.9.7
      • getName

        EvaluationName getName​(java.lang.String name,
                               java.lang.String sheetName)
        named range name matching is case-insensitive
        Since:
        3.9.5
      • createName

        Name createName()
        Return the underlying workbook
      • getTable

        Table getTable​(java.lang.String name)
        XSSF Only - gets a table that exists in the worksheet
      • getNameXPtg

        Ptg getNameXPtg​(java.lang.String name,
                        SheetIdentifier sheet)
        Return an external name (named range, function, user-defined function) Ptg
      • getExternalSheetIndex

        int getExternalSheetIndex​(java.lang.String sheetName)
        gets the externSheet index for a sheet from this workbook
      • getExternalSheetIndex

        int getExternalSheetIndex​(java.lang.String workbookName,
                                  java.lang.String sheetName)
        gets the externSheet index for a sheet from an external workbook
        Parameters:
        workbookName - e.g. "Budget.xls"
        sheetName - a name of a sheet in that workbook
      • getSpreadsheetVersion

        SpreadsheetVersion getSpreadsheetVersion()
        Returns an enum holding spreadhseet properties specific to an Excel version ( max column and row numbers, max arguments to a function, etc.)