org.apache.poi.xssf.streaming

## Class SXSSFWorkbook

- java.lang.Object
- - org.apache.poi.xssf.streaming.SXSSFWorkbook

- All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, java.lang.Iterable<Sheet>, Workbook
  Direct Known Subclasses:
    SXSSFWorkbookWithCustomZipEntrySource

      public class SXSSFWorkbook
      extends java.lang.Object
      implements Workbook

  Streaming version of XSSFWorkbook implementing the "BigGridDemo" strategy. This allows to write very large files without running out of memory as only a configurable portion of the rows are kept in memory at any one time. You can provide a template workbook which is used as basis for the written data. See https://poi.apache.org/spreadsheet/how-to.html#sxssf for details. Please note that there are still things that still may consume a large amount of memory based on which features you are using, e.g. merged regions, comments, ... are still only stored in memory and thus may require a lot of memory if used extensively. SXSSFWorkbook defaults to using inline strings instead of a shared strings table. This is very efficient, since no document content needs to be kept in memory, but is also known to produce documents that are incompatible with some clients. With shared strings enabled all unique strings in the document has to be kept in memory. Depending on your document content this could use a lot more resources than with shared strings disabled. Carefully review your memory budget and compatibility needs before deciding whether to enable shared strings or not.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `DEFAULT_WINDOW_SIZE` Specifies how many rows can be accessed at most via `SXSSFSheet.getRow(int)`.

    - ### Fields inherited from interface org.apache.poi.ss.usermodel.Workbook

      `PICTURE_TYPE_DIB, PICTURE_TYPE_EMF, PICTURE_TYPE_JPEG, PICTURE_TYPE_PICT, PICTURE_TYPE_PNG, PICTURE_TYPE_WMF`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SXSSFWorkbook()` Construct a new workbook with default row window size
    `SXSSFWorkbook(int rowAccessWindowSize)` Construct an empty workbook and specify the window for row access.
    `SXSSFWorkbook(XSSFWorkbook workbook)` Construct a workbook from a template.
    `SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize)` Constructs an workbook from an existing workbook.
    `SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles)` Constructs an workbook from an existing workbook.
    `SXSSFWorkbook(XSSFWorkbook workbook, int rowAccessWindowSize, boolean compressTmpFiles, boolean useSharedStringsTable)` Constructs an workbook from an existing workbook.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `addOlePackage(byte[] oleData, java.lang.String label, java.lang.String fileName, java.lang.String command)` Adds an OLE package manager object with the given content to the sheet
    `int` | `addPicture(byte[] pictureData, int format)` Adds a picture to the workbook.
    `void` | `addToolPack(UDFFinder toopack)` Register a new toolpack in this workbook.
    `Sheet` | `cloneSheet(int sheetNum)` Not implemented for SXSSFWorkbook Create an Sheet from an existing sheet in the Workbook.
    `void` | `close()` Closes the underlying `XSSFWorkbook` and `OPCPackage` on which this Workbook is based, if any.
    `protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream` | `createArchiveOutputStream(java.io.OutputStream out)`
    `CellStyle` | `createCellStyle()` Create a new Cell style and add it to the workbook's style table
    `DataFormat` | `createDataFormat()` Returns the instance of DataFormat for this workbook.
    `Font` | `createFont()` Create a new Font and add it to the workbook's font table
    `Name` | `createName()` Creates a new (uninitialised) defined name in this workbook
    `SXSSFSheet` | `createSheet()` Sreate an Sheet for this Workbook, adds it to the sheets and returns the high level representation.
    `SXSSFSheet` | `createSheet(java.lang.String sheetname)` Create an Sheet for this Workbook, adds it to the sheets and returns the high level representation.
    `protected SheetDataWriter` | `createSheetDataWriter()`
    `boolean` | `dispose()` Dispose of temporary files backing this workbook on disk.
    `Font` | `findFont(boolean bold, short color, short fontHeight, java.lang.String name, boolean italic, boolean strikeout, short typeOffset, byte underline)` Finds a font that matches the one with the supplied attributes
    `protected void` | `flushSheets()`
    `int` | `getActiveSheetIndex()` Convenience method to get the active sheet.
    `java.util.List<? extends Name>` | `getAllNames()` Returns all defined names
    `java.util.List<? extends PictureData>` | `getAllPictures()` Gets all pictures from the Workbook.
    `CellStyle` | `getCellStyleAt(int idx)` Get the cell style object at the given index
    `CreationHelper` | `getCreationHelper()` Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF, XSSF and SXSSF.
    `int` | `getFirstVisibleTab()` Gets the first tab that is displayed in the list of tabs in excel.
    `Font` | `getFontAt(int idx)` Get the font at the given index number
    `Font` | `getFontAt(short idx)` Deprecated.
    `boolean` | `getForceFormulaRecalculation()` Whether Excel will be asked to recalculate all formulas when the workbook is opened.
    `Row.MissingCellPolicy` | `getMissingCellPolicy()` Retrieves the current policy on what to do when getting missing or blank cells from a row.
    `Name` | `getName(java.lang.String name)`
    `Name` | `getNameAt(int nameIndex)` Deprecated. 3.16. New projects should avoid accessing named ranges by index.
    `int` | `getNameIndex(java.lang.String name)` Deprecated. 3.16. New projects should avoid accessing named ranges by index. Use `getName(String)` instead.
    `java.util.List<? extends Name>` | `getNames(java.lang.String name)` Returns all defined names with the given name.
    `short` | `getNumberOfFonts()` Deprecated.
    `int` | `getNumberOfFontsAsInt()` Get the number of fonts in the font table
    `int` | `getNumberOfNames()`
    `int` | `getNumberOfSheets()` Get the number of spreadsheets in the workbook
    `int` | `getNumCellStyles()` Get the number of styles the workbook contains
    `java.lang.String` | `getPrintArea(int sheetIndex)` Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified.
    `int` | `getRandomAccessWindowSize()` See the constructors for a more detailed description of the sliding window of rows.
    `protected SharedStringsTable` | `getSharedStringSource()`
    `SXSSFSheet` | `getSheet(java.lang.String name)` Get sheet with the given name
    `SXSSFSheet` | `getSheetAt(int index)` Get the Sheet object at the given index.
    `int` | `getSheetIndex(Sheet sheet)` Returns the index of the given sheet
    `int` | `getSheetIndex(java.lang.String name)` Returns the index of the sheet by his name
    `java.lang.String` | `getSheetName(int sheet)` Set the sheet name
    `SheetVisibility` | `getSheetVisibility(int sheetIx)` Get the visibility (visible, hidden, very hidden) of a sheet in this workbook
    `SpreadsheetVersion` | `getSpreadsheetVersion()` Returns the spreadsheet version (EXCLE2007) of this workbook
    `XSSFWorkbook` | `getXSSFWorkbook()`
    `protected void` | `injectData(ZipEntrySource zipEntrySource, java.io.OutputStream out)`
    `boolean` | `isCompressTempFiles()` Get whether temp files should be compressed.
    `protected boolean` | `isDate1904()`
    `boolean` | `isHidden()`
    `boolean` | `isSheetHidden(int sheetIx)` Check whether a sheet is hidden.
    `boolean` | `isSheetVeryHidden(int sheetIx)` Check whether a sheet is very hidden.
    `java.util.Iterator<Sheet>` | `iterator()` Alias for `sheetIterator()` to allow foreach loops
    `int` | `linkExternalWorkbook(java.lang.String name, Workbook workbook)` Not implemented for SXSSFWorkbook Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one.
    `void` | `removeName(int index)` Deprecated. 3.16. New projects should use `removeName(Name)`.
    `void` | `removeName(Name name)` Remove the given defined name
    `void` | `removeName(java.lang.String name)` Deprecated. 3.16. New projects should use `removeName(Name)`.
    `void` | `removePrintArea(int sheetIndex)` Delete the printarea for the sheet specified
    `void` | `removeSheetAt(int index)` Removes sheet at the given index
    `void` | `setActiveSheet(int sheetIndex)` Convenience method to set the active sheet.
    `void` | `setCompressTempFiles(boolean compress)` Set whether temp files should be compressed.
    `void` | `setFirstVisibleTab(int sheetIndex)` Sets the first tab that is displayed in the list of tabs in excel.
    `void` | `setForceFormulaRecalculation(boolean value)` Whether the application shall perform a full recalculation when the workbook is opened.
    `void` | `setHidden(boolean hiddenFlag)`
    `void` | `setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)` Sets the policy on what to do when getting missing or blank cells from a row.
    `void` | `setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)` For the Convenience of Java Programmers maintaining pointers.
    `void` | `setPrintArea(int sheetIndex, java.lang.String reference)` Sets the printarea for the sheet provided
    `void` | `setSelectedTab(int index)` Sets the tab whose data is actually seen when the sheet is opened.
    `void` | `setSheetHidden(int sheetIx, boolean hidden)` Hide or unhide a sheet.
    `void` | `setSheetName(int sheet, java.lang.String name)` Set the sheet name.
    `void` | `setSheetOrder(java.lang.String sheetname, int pos)` Sets the order of appearance for a given sheet.
    `void` | `setSheetVisibility(int sheetIx, SheetVisibility visibility)` Hide or unhide a sheet.
    `void` | `setZip64Mode(org.apache.commons.compress.archivers.zip.Zip64Mode zip64Mode)`
    `java.util.Iterator<Sheet>` | `sheetIterator()` Returns an iterator of the sheets in the workbook in sheet order.
    `void` | `write(java.io.OutputStream stream)` Write out this workbook to an OutputStream.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

- - ### Field Detail

    - #### DEFAULT_WINDOW_SIZE

          public static final int DEFAULT_WINDOW_SIZE

      Specifies how many rows can be accessed at most via `SXSSFSheet.getRow(int)`. When a new node is created via `SXSSFSheet.createRow(int)` and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via `SXSSFSheet.getRow(int)` anymore.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### SXSSFWorkbook

          public SXSSFWorkbook()

      Construct a new workbook with default row window size

    - #### SXSSFWorkbook

          public SXSSFWorkbook(XSSFWorkbook workbook)

      Construct a workbook from a template.

      There are three use-cases to use SXSSFWorkbook(XSSFWorkbook) :
      1. Append new sheets to existing workbooks. You can open existing workbook from a file or create on the fly with XSSF.
      2. Append rows to existing sheets. The row number MUST be greater than `max(rownum)` in the template sheet.
      3. Use existing workbook as a template and re-use global objects such as cell styles, formats, images, etc.
      All three use cases can work in a combination. What is not supported:
      - Access initial cells and rows in the template. After constructing all internal windows are empty and `SXSSFSheet.getRow(int)` and `SXSSFRow.getCell(int)` return `null`.
      - Override existing cells and rows. The API silently allows that but the output file is invalid and Excel cannot read it.
      Parameters:
        `workbook` - the template workbook

    - #### SXSSFWorkbook

          public SXSSFWorkbook(XSSFWorkbook workbook,
                               int rowAccessWindowSize)

      Constructs an workbook from an existing workbook.

      When a new node is created via `SXSSFSheet.createRow(int)` and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via `SXSSFSheet.getRow(int)` anymore.

      A value of `-1` indicates unlimited access. In this case all records that have not been flushed by a call to `flush()` are available for random access.

      A value of `0` is not allowed because it would flush any newly created row without having a chance to specify any cells.

      Parameters:
        `rowAccessWindowSize` - the number of rows that are kept in memory until flushed out, see above.

    - #### SXSSFWorkbook

          public SXSSFWorkbook(XSSFWorkbook workbook,
                               int rowAccessWindowSize,
                               boolean compressTmpFiles)

      Constructs an workbook from an existing workbook.

      When a new node is created via `SXSSFSheet.createRow(int)` and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via `SXSSFSheet.getRow(int)` anymore.

      A value of `-1` indicates unlimited access. In this case all records that have not been flushed by a call to `flush()` are available for random access.

      A value of `0` is not allowed because it would flush any newly created row without having a chance to specify any cells.

      Parameters:
        `rowAccessWindowSize` - the number of rows that are kept in memory until flushed out, see above.
        `compressTmpFiles` - whether to use gzip compression for temporary files

    - #### SXSSFWorkbook

          public SXSSFWorkbook(XSSFWorkbook workbook,
                               int rowAccessWindowSize,
                               boolean compressTmpFiles,
                               boolean useSharedStringsTable)

      Constructs an workbook from an existing workbook.

      When a new node is created via `SXSSFSheet.createRow(int)` and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via `SXSSFSheet.getRow(int)` anymore.

      A value of `-1` indicates unlimited access. In this case all records that have not been flushed by a call to `flush()` are available for random access.

      A value of `0` is not allowed because it would flush any newly created row without having a chance to specify any cells.

      Parameters:
        `workbook` - the template workbook
        `rowAccessWindowSize` - the number of rows that are kept in memory until flushed out, see above.
        `compressTmpFiles` - whether to use gzip compression for temporary files
        `useSharedStringsTable` - whether to use a shared strings table

    - #### SXSSFWorkbook

          public SXSSFWorkbook(int rowAccessWindowSize)

      Construct an empty workbook and specify the window for row access.

      When a new node is created via `SXSSFSheet.createRow(int)` and the total number of unflushed records would exceed the specified value, then the row with the lowest index value is flushed and cannot be accessed via `SXSSFSheet.getRow(int)` anymore.

      A value of `-1` indicates unlimited access. In this case all records that have not been flushed by a call to `flush()` are available for random access.

      A value of `0` is not allowed because it would flush any newly created row without having a chance to specify any cells.

      Parameters:
        `rowAccessWindowSize` - the number of rows that are kept in memory until flushed out, see above.

  - ### Method Detail

    - #### getRandomAccessWindowSize

          public int getRandomAccessWindowSize()

      See the constructors for a more detailed description of the sliding window of rows.
      Returns:
        The number of rows that are kept in memory at once before flushing them out.

    - #### setZip64Mode

          @Beta
          public void setZip64Mode(org.apache.commons.compress.archivers.zip.Zip64Mode zip64Mode)

      Parameters:
        `zip64Mode` - `Zip64Mode`
      Since:
        4.1.0

    - #### isCompressTempFiles

          public boolean isCompressTempFiles()

      Get whether temp files should be compressed.
      Returns:
        whether to compress temp files

    - #### setCompressTempFiles

          public void setCompressTempFiles(boolean compress)

      Set whether temp files should be compressed.

      SXSSF writes sheet data in temporary files (a temp file per-sheet) and the size of these temp files can grow to to a very large size, e.g. for a 20 MB csv data the size of the temp xml file become few GB large. If the "compress" flag is set to `true` then the temporary XML is gzipped.

      Please note the the "compress" option may cause performance penalty.

      Setting this option only affects compression for subsequent `createSheet()` calls.

      Parameters:
        `compress` - whether to compress temp files

    - #### getSharedStringSource

          @Internal
          protected SharedStringsTable getSharedStringSource()

    - #### createSheetDataWriter

          protected SheetDataWriter createSheetDataWriter()
                                                   throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### injectData

          protected void injectData(ZipEntrySource zipEntrySource,
                                    java.io.OutputStream out)
                             throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### createArchiveOutputStream

          protected org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream createArchiveOutputStream(java.io.OutputStream out)

    - #### getXSSFWorkbook

          public XSSFWorkbook getXSSFWorkbook()

    - #### getActiveSheetIndex

          public int getActiveSheetIndex()

      Convenience method to get the active sheet. The active sheet is is the sheet which is currently displayed when the workbook is viewed in Excel. 'Selected' sheet(s) is a distinct concept.
      Specified by:
        `getActiveSheetIndex` in interface `Workbook`
      Returns:
        the index of the active sheet (0-based)

    - #### setActiveSheet

          public void setActiveSheet(int sheetIndex)

      Convenience method to set the active sheet. The active sheet is is the sheet which is currently displayed when the workbook is viewed in Excel. 'Selected' sheet(s) is a distinct concept.
      Specified by:
        `setActiveSheet` in interface `Workbook`
      Parameters:
        `sheetIndex` - index of the active sheet (0-based)

    - #### getFirstVisibleTab

          public int getFirstVisibleTab()

      Gets the first tab that is displayed in the list of tabs in excel.
      Specified by:
        `getFirstVisibleTab` in interface `Workbook`
      Returns:
        the first tab that to display in the list of tabs (0-based).

    - #### setFirstVisibleTab

          public void setFirstVisibleTab(int sheetIndex)

      Sets the first tab that is displayed in the list of tabs in excel.
      Specified by:
        `setFirstVisibleTab` in interface `Workbook`
      Parameters:
        `sheetIndex` - the first tab that to display in the list of tabs (0-based)

    - #### setSheetOrder

          public void setSheetOrder(java.lang.String sheetname,
                                    int pos)

      Sets the order of appearance for a given sheet.
      Specified by:
        `setSheetOrder` in interface `Workbook`
      Parameters:
        `sheetname` - the name of the sheet to reorder
        `pos` - the position that we want to insert the sheet into (0 based)

    - #### setSelectedTab

          public void setSelectedTab(int index)

      Sets the tab whose data is actually seen when the sheet is opened. This may be different from the "selected sheet" since excel seems to allow you to show the data of one sheet when another is seen "selected" in the tabs (at the bottom).
      Specified by:
        `setSelectedTab` in interface `Workbook`
      Parameters:
        `index` - the index of the sheet to select (0 based)
      See Also:
        `Sheet.setSelected(boolean)`

    - #### setSheetName

          public void setSheetName(int sheet,
                                   java.lang.String name)

      Set the sheet name.
      Specified by:
        `setSheetName` in interface `Workbook`
      Parameters:
        `sheet` - number (0 based)
      Throws:
        `java.lang.IllegalArgumentException` - if the name is greater than 31 chars or contains `/\?*[]`
      See Also:
        `Workbook.createSheet(String)`, `WorkbookUtil.createSafeSheetName(String nameProposal)`

    - #### getSheetName

          public java.lang.String getSheetName(int sheet)

      Set the sheet name
      Specified by:
        `getSheetName` in interface `Workbook`
      Parameters:
        `sheet` - sheet number (0 based)
      Returns:
        Sheet name

    - #### getSheetIndex

          public int getSheetIndex(java.lang.String name)

      Returns the index of the sheet by his name
      Specified by:
        `getSheetIndex` in interface `Workbook`
      Parameters:
        `name` - the sheet name
      Returns:
        index of the sheet (0 based)

    - #### getSheetIndex

          public int getSheetIndex(Sheet sheet)

      Returns the index of the given sheet
      Specified by:
        `getSheetIndex` in interface `Workbook`
      Parameters:
        `sheet` - the sheet to look up
      Returns:
        index of the sheet (0 based)

    - #### createSheet

          public SXSSFSheet createSheet()

      Sreate an Sheet for this Workbook, adds it to the sheets and returns the high level representation. Use this to create new sheets.
      Specified by:
        `createSheet` in interface `Workbook`
      Returns:
        Sheet representing the new sheet.

    - #### createSheet

          public SXSSFSheet createSheet(java.lang.String sheetname)

      Create an Sheet for this Workbook, adds it to the sheets and returns the high level representation. Use this to create new sheets.
      Specified by:
        `createSheet` in interface `Workbook`
      Parameters:
        `sheetname` - sheetname to set for the sheet.
      Returns:
        Sheet representing the new sheet.
      Throws:
        `java.lang.IllegalArgumentException` - if the name is greater than 31 chars or contains `/\?*[]`
      See Also:
        `WorkbookUtil.createSafeSheetName(String nameProposal)`

    - #### cloneSheet

          @NotImplemented
          public Sheet cloneSheet(int sheetNum)

      Not implemented for SXSSFWorkbook Create an Sheet from an existing sheet in the Workbook.
      Specified by:
        `cloneSheet` in interface `Workbook`
      Returns:
        Sheet representing the cloned sheet.

    - #### getNumberOfSheets

          public int getNumberOfSheets()

      Get the number of spreadsheets in the workbook
      Specified by:
        `getNumberOfSheets` in interface `Workbook`
      Returns:
        the number of sheets

    - #### sheetIterator

          public java.util.Iterator<Sheet> sheetIterator()

      Returns an iterator of the sheets in the workbook in sheet order. Includes hidden and very hidden sheets.
      Specified by:
        `sheetIterator` in interface `Workbook`
      Returns:
        an iterator of the sheets.

    - #### iterator

          public java.util.Iterator<Sheet> iterator()

      Alias for `sheetIterator()` to allow foreach loops
      Specified by:
        `iterator` in interface `java.lang.Iterable<Sheet>`

    - #### getSheetAt

          public SXSSFSheet getSheetAt(int index)

      Get the Sheet object at the given index.
      Specified by:
        `getSheetAt` in interface `Workbook`
      Parameters:
        `index` - of the sheet number (0-based physical and logical)
      Returns:
        Sheet at the provided index

    - #### getSheet

          public SXSSFSheet getSheet(java.lang.String name)

      Get sheet with the given name
      Specified by:
        `getSheet` in interface `Workbook`
      Parameters:
        `name` - of the sheet
      Returns:
        Sheet with the name provided or `null` if it does not exist

    - #### removeSheetAt

          public void removeSheetAt(int index)

      Removes sheet at the given index
      Specified by:
        `removeSheetAt` in interface `Workbook`
      Parameters:
        `index` - of the sheet to remove (0-based)

    - #### createFont

          public Font createFont()

      Create a new Font and add it to the workbook's font table
      Specified by:
        `createFont` in interface `Workbook`
      Returns:
        new font object

    - #### findFont

          public Font findFont(boolean bold,
                               short color,
                               short fontHeight,
                               java.lang.String name,
                               boolean italic,
                               boolean strikeout,
                               short typeOffset,
                               byte underline)

      Finds a font that matches the one with the supplied attributes
      Specified by:
        `findFont` in interface `Workbook`
      Returns:
        the font with the matched attributes or `null`

    - #### getNumberOfFonts

          @Deprecated
          public short getNumberOfFonts()

      Deprecated.
      Description copied from interface: `Workbook`
      Get the number of fonts in the font table
      Specified by:
        `getNumberOfFonts` in interface `Workbook`
      Returns:
        number of fonts

    - #### getNumberOfFontsAsInt

          public int getNumberOfFontsAsInt()

      Description copied from interface: `Workbook`
      Get the number of fonts in the font table
      Specified by:
        `getNumberOfFontsAsInt` in interface `Workbook`
      Returns:
        number of fonts

    - #### getFontAt

          @Deprecated
          public Font getFontAt(short idx)

      Deprecated.
      Description copied from interface: `Workbook`
      Get the font at the given index number
      Specified by:
        `getFontAt` in interface `Workbook`
      Parameters:
        `idx` - index number (0-based)
      Returns:
        font at the index

    - #### getFontAt

          public Font getFontAt(int idx)

      Description copied from interface: `Workbook`
      Get the font at the given index number
      Specified by:
        `getFontAt` in interface `Workbook`
      Parameters:
        `idx` - index number (0-based)
      Returns:
        font at the index

    - #### createCellStyle

          public CellStyle createCellStyle()

      Create a new Cell style and add it to the workbook's style table
      Specified by:
        `createCellStyle` in interface `Workbook`
      Returns:
        the new Cell Style object

    - #### getNumCellStyles

          public int getNumCellStyles()

      Get the number of styles the workbook contains
      Specified by:
        `getNumCellStyles` in interface `Workbook`
      Returns:
        count of cell styles

    - #### getCellStyleAt

          public CellStyle getCellStyleAt(int idx)

      Get the cell style object at the given index
      Specified by:
        `getCellStyleAt` in interface `Workbook`
      Parameters:
        `idx` - index within the set of styles (0-based)
      Returns:
        CellStyle object at the index

    - #### close

          public void close()
                     throws java.io.IOException

      Closes the underlying `XSSFWorkbook` and `OPCPackage` on which this Workbook is based, if any.

      Once this has been called, no further operations, updates or reads should be performed on the Workbook.

      Specified by:
        `close` in interface `java.io.Closeable`
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Specified by:
        `close` in interface `Workbook`
      Throws:
        `java.io.IOException`

    - #### write

          public void write(java.io.OutputStream stream)
                     throws java.io.IOException

      Write out this workbook to an OutputStream.
      Specified by:
        `write` in interface `Workbook`
      Parameters:
        `stream` - - the java OutputStream you wish to write to
      Throws:
        `java.io.IOException` - if anything can't be written.

    - #### flushSheets

          protected void flushSheets()
                              throws java.io.IOException

      Throws:
        `java.io.IOException`

    - #### dispose

          public boolean dispose()

      Dispose of temporary files backing this workbook on disk. Calling this method will render the workbook unusable.
      Returns:
        true if all temporary files were deleted successfully.

    - #### getNumberOfNames

          public int getNumberOfNames()

      Specified by:
        `getNumberOfNames` in interface `Workbook`
      Returns:
        the total number of defined names in this workbook

    - #### getName

          public Name getName(java.lang.String name)

      Specified by:
        `getName` in interface `Workbook`
      Parameters:
        `name` - the name of the defined name
      Returns:
        the defined name with the specified name. `null` if not found.

    - #### getNames

          public java.util.List<? extends Name> getNames(java.lang.String name)

      Returns all defined names with the given name.
      Specified by:
        `getNames` in interface `Workbook`
      Parameters:
        `name` - the name of the defined name
      Returns:
        a list of the defined names with the specified name. An empty list is returned if none is found.

    - #### getAllNames

          public java.util.List<? extends Name> getAllNames()

      Returns all defined names
      Specified by:
        `getAllNames` in interface `Workbook`
      Returns:
        all defined names

    - #### createName

          public Name createName()

      Creates a new (uninitialised) defined name in this workbook
      Specified by:
        `createName` in interface `Workbook`
      Returns:
        new defined name object

    - #### removeName

          public void removeName(Name name)

      Remove the given defined name
      Specified by:
        `removeName` in interface `Workbook`
      Parameters:
        `name` - the name to remove

    - #### setPrintArea

          public void setPrintArea(int sheetIndex,
                                   java.lang.String reference)

      Sets the printarea for the sheet provided

      i.e. Reference = $A$1:$B$2

      Specified by:
        `setPrintArea` in interface `Workbook`
      Parameters:
        `sheetIndex` - Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
        `reference` - Valid name Reference for the Print Area

    - #### setPrintArea

          public void setPrintArea(int sheetIndex,
                                   int startColumn,
                                   int endColumn,
                                   int startRow,
                                   int endRow)

      For the Convenience of Java Programmers maintaining pointers.
      Specified by:
        `setPrintArea` in interface `Workbook`
      Parameters:
        `sheetIndex` - Zero-based sheet index (0 = First Sheet)
        `startColumn` - Column to begin printarea
        `endColumn` - Column to end the printarea
        `startRow` - Row to begin the printarea
        `endRow` - Row to end the printarea
      See Also:
        `setPrintArea(int, String)`

    - #### getPrintArea

          public java.lang.String getPrintArea(int sheetIndex)

      Retrieves the reference for the printarea of the specified sheet, the sheet name is appended to the reference even if it was not specified.
      Specified by:
        `getPrintArea` in interface `Workbook`
      Parameters:
        `sheetIndex` - Zero-based sheet index (0 Represents the first sheet to keep consistent with java)
      Returns:
        String Null if no print area has been defined

    - #### removePrintArea

          public void removePrintArea(int sheetIndex)

      Delete the printarea for the sheet specified
      Specified by:
        `removePrintArea` in interface `Workbook`
      Parameters:
        `sheetIndex` - Zero-based sheet index (0 = First Sheet)

    - #### getMissingCellPolicy

          public Row.MissingCellPolicy getMissingCellPolicy()

      Retrieves the current policy on what to do when getting missing or blank cells from a row.

      The default is to return blank and null cells. `Row.MissingCellPolicy`

      Specified by:
        `getMissingCellPolicy` in interface `Workbook`

    - #### setMissingCellPolicy

          public void setMissingCellPolicy(Row.MissingCellPolicy missingCellPolicy)

      Sets the policy on what to do when getting missing or blank cells from a row. This will then apply to all calls to `Row.getCell(int)`. See `Row.MissingCellPolicy`
      Specified by:
        `setMissingCellPolicy` in interface `Workbook`

    - #### createDataFormat

          public DataFormat createDataFormat()

      Returns the instance of DataFormat for this workbook.
      Specified by:
        `createDataFormat` in interface `Workbook`
      Returns:
        the DataFormat object

    - #### addPicture

          public int addPicture(byte[] pictureData,
                                int format)

      Adds a picture to the workbook.
      Specified by:
        `addPicture` in interface `Workbook`
      Parameters:
        `pictureData` - The bytes of the picture
        `format` - The format of the picture.
      Returns:
        the index to this picture (1 based).
      See Also:
        `Workbook.PICTURE_TYPE_EMF`, `Workbook.PICTURE_TYPE_WMF`, `Workbook.PICTURE_TYPE_PICT`, `Workbook.PICTURE_TYPE_JPEG`, `Workbook.PICTURE_TYPE_PNG`, `Workbook.PICTURE_TYPE_DIB`

    - #### getAllPictures

          public java.util.List<? extends PictureData> getAllPictures()

      Gets all pictures from the Workbook.
      Specified by:
        `getAllPictures` in interface `Workbook`
      Returns:
        the list of pictures (a list of `PictureData` objects.)

    - #### getCreationHelper

          public CreationHelper getCreationHelper()

      Returns an object that handles instantiating concrete classes of the various instances one needs for HSSF, XSSF and SXSSF.
      Specified by:
        `getCreationHelper` in interface `Workbook`

    - #### isDate1904

          protected boolean isDate1904()

    - #### isHidden

          @NotImplemented(value="XSSFWorkbook#isHidden is not implemented")
          public boolean isHidden()

      Specified by:
        `isHidden` in interface `Workbook`
      Returns:
        `false` if this workbook is not visible in the GUI

    - #### setHidden

          @NotImplemented(value="XSSFWorkbook#setHidden is not implemented")
          public void setHidden(boolean hiddenFlag)

      Specified by:
        `setHidden` in interface `Workbook`
      Parameters:
        `hiddenFlag` - pass `false` to make the workbook visible in the GUI

    - #### isSheetHidden

          public boolean isSheetHidden(int sheetIx)

      Description copied from interface: `Workbook`
      Check whether a sheet is hidden.

      Note that a sheet could instead be set to be very hidden, which is different (`Workbook.isSheetVeryHidden(int)`)

      Specified by:
        `isSheetHidden` in interface `Workbook`
      Parameters:
        `sheetIx` - Number
      Returns:
        `true` if sheet is hidden
      See Also:
        `Workbook.getSheetVisibility(int)`

    - #### isSheetVeryHidden

          public boolean isSheetVeryHidden(int sheetIx)

      Description copied from interface: `Workbook`
      Check whether a sheet is very hidden.

      This is different from the normal hidden status (`Workbook.isSheetHidden(int)`)

      Specified by:
        `isSheetVeryHidden` in interface `Workbook`
      Parameters:
        `sheetIx` - sheet index to check
      Returns:
        `true` if sheet is very hidden
      See Also:
        `Workbook.getSheetVisibility(int)`

    - #### getSheetVisibility

          public SheetVisibility getSheetVisibility(int sheetIx)

      Description copied from interface: `Workbook`
      Get the visibility (visible, hidden, very hidden) of a sheet in this workbook
      Specified by:
        `getSheetVisibility` in interface `Workbook`
      Parameters:
        `sheetIx` - the index of the sheet
      Returns:
        the sheet visibility

    - #### setSheetHidden

          public void setSheetHidden(int sheetIx,
                                     boolean hidden)

      Description copied from interface: `Workbook`
      Hide or unhide a sheet. Please note that the sheet currently set as active sheet (sheet 0 in a newly created workbook or the one set via setActiveSheet()) cannot be hidden.
      Specified by:
        `setSheetHidden` in interface `Workbook`
      Parameters:
        `sheetIx` - the sheet index (0-based)
        `hidden` - True to mark the sheet as hidden, false otherwise
      See Also:
        `Workbook.setSheetVisibility(int, SheetVisibility)`

    - #### setSheetVisibility

          public void setSheetVisibility(int sheetIx,
                                         SheetVisibility visibility)

      Description copied from interface: `Workbook`
      Hide or unhide a sheet. Please note that the sheet currently set as active sheet (sheet 0 in a newly created workbook or the one set via setActiveSheet()) cannot be hidden.
      Specified by:
        `setSheetVisibility` in interface `Workbook`
      Parameters:
        `sheetIx` - the sheet index (0-based)
        `visibility` - the sheet visibility to set

    - #### getNameAt

          @Deprecated
           @Removal(version="3.20")
          public Name getNameAt(int nameIndex)

      Deprecated. 3.16. New projects should avoid accessing named ranges by index.
      Specified by:
        `getNameAt` in interface `Workbook`
      Parameters:
        `nameIndex` - position of the named range (0-based)
      Returns:
        the defined name at the specified index
      Throws:
        `java.lang.IllegalArgumentException` - if the supplied index is invalid

    - #### getNameIndex

          @Deprecated
           @Removal(version="3.20")
          public int getNameIndex(java.lang.String name)

      Deprecated. 3.16. New projects should avoid accessing named ranges by index. Use `getName(String)` instead.
      Gets the defined name index by name Note: Excel defined names are case-insensitive and this method performs a case-insensitive search.
      Specified by:
        `getNameIndex` in interface `Workbook`
      Parameters:
        `name` - the name of the defined name
      Returns:
        zero based index of the defined name. `-1` if not found.

    - #### removeName

          @Deprecated
           @Removal(version="3.20")
          public void removeName(int index)

      Deprecated. 3.16. New projects should use `removeName(Name)`.
      Remove the defined name at the specified index
      Specified by:
        `removeName` in interface `Workbook`
      Parameters:
        `index` - named range index (0 based)

    - #### removeName

          @Deprecated
           @Removal(version="3.20")
          public void removeName(java.lang.String name)

      Deprecated. 3.16. New projects should use `removeName(Name)`.
      Remove a defined name by name
      Specified by:
        `removeName` in interface `Workbook`
      Parameters:
        `name` - the name of the defined name

    - #### linkExternalWorkbook

          @NotImplemented
          public int linkExternalWorkbook(java.lang.String name,
                                                          Workbook workbook)

      Not implemented for SXSSFWorkbook Adds the LinkTable records required to allow formulas referencing the specified external workbook to be added to this one. Allows formulas such as "[MyOtherWorkbook]Sheet3!$A$5" to be added to the file, for workbooks not already referenced. Note: this is not implemented and thus currently throws an Exception stating this.
      Specified by:
        `linkExternalWorkbook` in interface `Workbook`
      Parameters:
        `name` - The name the workbook will be referenced as in formulas
        `workbook` - The open workbook to fetch the link required information from
      Throws:
        `java.lang.RuntimeException` - stating that this method is not implemented yet.

    - #### addToolPack

          public void addToolPack(UDFFinder toopack)

      Register a new toolpack in this workbook.
      Specified by:
        `addToolPack` in interface `Workbook`
      Parameters:
        `toopack` - the toolpack to register

    - #### setForceFormulaRecalculation

          public void setForceFormulaRecalculation(boolean value)

      Whether the application shall perform a full recalculation when the workbook is opened.

      Typically you want to force formula recalculation when you modify cell formulas or values of a workbook previously created by Excel. When set to 0, this flag will tell Excel that it needs to recalculate all formulas in the workbook the next time the file is opened.

      Specified by:
        `setForceFormulaRecalculation` in interface `Workbook`
      Parameters:
        `value` - true if the application will perform a full recalculation of workbook values when the workbook is opened
      Since:
        3.8

    - #### getForceFormulaRecalculation

          public boolean getForceFormulaRecalculation()

      Whether Excel will be asked to recalculate all formulas when the workbook is opened.
      Specified by:
        `getForceFormulaRecalculation` in interface `Workbook`

    - #### getSpreadsheetVersion

          public SpreadsheetVersion getSpreadsheetVersion()

      Returns the spreadsheet version (EXCLE2007) of this workbook
      Specified by:
        `getSpreadsheetVersion` in interface `Workbook`
      Returns:
        EXCEL2007 SpreadsheetVersion enum
      Since:
        3.14 beta 2

    - #### addOlePackage

          public int addOlePackage(byte[] oleData,
                                   java.lang.String label,
                                   java.lang.String fileName,
                                   java.lang.String command)
                            throws java.io.IOException

      Description copied from interface: `Workbook`
      Adds an OLE package manager object with the given content to the sheet
      Specified by:
        `addOlePackage` in interface `Workbook`
      Parameters:
        `oleData` - the payload
        `label` - the label of the payload
        `fileName` - the original filename
        `command` - the command to open the payload
      Returns:
        the index of the added ole object, i.e. the storage id
      Throws:
        `java.io.IOException` - if the object can't be embedded

Copyright 2020 The Apache Software Foundation or its licensors, as applicable.