Class OdsWorkbook

java.lang.Object
org.spdx.spreadsheetstore.ods.OdsWorkbook
All Implemented Interfaces:
Closeable, AutoCloseable, Iterable<org.apache.poi.ss.usermodel.Sheet>, org.apache.poi.ss.usermodel.Workbook

public class OdsWorkbook extends Object implements org.apache.poi.ss.usermodel.Workbook
Adapter for Apache POI Workbook over a SODS SpreadSheet. Serves as the primary entry point for ODS read/write operations within the POI interface layer.
  • Constructor Details

    • OdsWorkbook

      public OdsWorkbook()
      Creates an empty ODS workbook.
    • OdsWorkbook

      public OdsWorkbook(InputStream is) throws IOException
      Reads an ODS workbook from an input stream.
      Parameters:
      is - Input stream containing the ODS document.
      Throws:
      IOException - If an I/O error occurs while parsing.
  • Method Details

    • getActiveSheetIndex

      public int getActiveSheetIndex()
      Specified by:
      getActiveSheetIndex in interface org.apache.poi.ss.usermodel.Workbook
    • setActiveSheet

      public void setActiveSheet(int sheetIndex)
      Specified by:
      setActiveSheet in interface org.apache.poi.ss.usermodel.Workbook
    • getFirstVisibleTab

      public int getFirstVisibleTab()
      Specified by:
      getFirstVisibleTab in interface org.apache.poi.ss.usermodel.Workbook
    • setFirstVisibleTab

      public void setFirstVisibleTab(int sheetIndex)
      Specified by:
      setFirstVisibleTab in interface org.apache.poi.ss.usermodel.Workbook
    • setSheetOrder

      public void setSheetOrder(String sheetname, int pos)
      Specified by:
      setSheetOrder in interface org.apache.poi.ss.usermodel.Workbook
    • setSelectedTab

      public void setSelectedTab(int index)
      Specified by:
      setSelectedTab in interface org.apache.poi.ss.usermodel.Workbook
    • setSheetName

      public void setSheetName(int sheet, String name)
      Specified by:
      setSheetName in interface org.apache.poi.ss.usermodel.Workbook
    • getSheetName

      public String getSheetName(int sheet)
      Specified by:
      getSheetName in interface org.apache.poi.ss.usermodel.Workbook
    • getSheetIndex

      public int getSheetIndex(String name)
      Specified by:
      getSheetIndex in interface org.apache.poi.ss.usermodel.Workbook
    • getSheetIndex

      public int getSheetIndex(org.apache.poi.ss.usermodel.Sheet sheet)
      Specified by:
      getSheetIndex in interface org.apache.poi.ss.usermodel.Workbook
    • createSheet

      public org.apache.poi.ss.usermodel.Sheet createSheet()
      Specified by:
      createSheet in interface org.apache.poi.ss.usermodel.Workbook
    • createSheet

      public org.apache.poi.ss.usermodel.Sheet createSheet(String sheetname)
      Specified by:
      createSheet in interface org.apache.poi.ss.usermodel.Workbook
    • cloneSheet

      public org.apache.poi.ss.usermodel.Sheet cloneSheet(int sheetNum)
      Specified by:
      cloneSheet in interface org.apache.poi.ss.usermodel.Workbook
    • sheetIterator

      public Iterator<org.apache.poi.ss.usermodel.Sheet> sheetIterator()
      Specified by:
      sheetIterator in interface org.apache.poi.ss.usermodel.Workbook
    • getNumberOfSheets

      public int getNumberOfSheets()
      Specified by:
      getNumberOfSheets in interface org.apache.poi.ss.usermodel.Workbook
    • getSheetAt

      public org.apache.poi.ss.usermodel.Sheet getSheetAt(int index)
      Specified by:
      getSheetAt in interface org.apache.poi.ss.usermodel.Workbook
    • getSheet

      public org.apache.poi.ss.usermodel.Sheet getSheet(String name)
      Specified by:
      getSheet in interface org.apache.poi.ss.usermodel.Workbook
    • removeSheetAt

      public void removeSheetAt(int index)
      Specified by:
      removeSheetAt in interface org.apache.poi.ss.usermodel.Workbook
    • createFont

      public org.apache.poi.ss.usermodel.Font createFont()
      Specified by:
      createFont in interface org.apache.poi.ss.usermodel.Workbook
    • findFont

      public org.apache.poi.ss.usermodel.Font findFont(boolean bold, short color, short fontHeight, String name, boolean italic, boolean strikeout, short typeOffset, byte underline)
      Specified by:
      findFont in interface org.apache.poi.ss.usermodel.Workbook
    • getNumberOfFonts

      public int getNumberOfFonts()
      Specified by:
      getNumberOfFonts in interface org.apache.poi.ss.usermodel.Workbook
    • getFontAt

      public org.apache.poi.ss.usermodel.Font getFontAt(int idx)
      Specified by:
      getFontAt in interface org.apache.poi.ss.usermodel.Workbook
    • createDataFormat

      public org.apache.poi.ss.usermodel.DataFormat createDataFormat()
      Specified by:
      createDataFormat in interface org.apache.poi.ss.usermodel.Workbook
    • createCellStyle

      public org.apache.poi.ss.usermodel.CellStyle createCellStyle()
      Specified by:
      createCellStyle in interface org.apache.poi.ss.usermodel.Workbook
    • getNumCellStyles

      public int getNumCellStyles()
      Specified by:
      getNumCellStyles in interface org.apache.poi.ss.usermodel.Workbook
    • getCellStyleAt

      public org.apache.poi.ss.usermodel.CellStyle getCellStyleAt(int idx)
      Specified by:
      getCellStyleAt in interface org.apache.poi.ss.usermodel.Workbook
    • write

      public void write(OutputStream stream) throws IOException
      Specified by:
      write in interface org.apache.poi.ss.usermodel.Workbook
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface org.apache.poi.ss.usermodel.Workbook
      Throws:
      IOException
    • addPicture

      public int addPicture(byte[] pictureData, int format)
      Stub returning 0 for POI interface parity. SODS attaches images per sheet; pictures are not used in SPDX serializations.
      Specified by:
      addPicture in interface org.apache.poi.ss.usermodel.Workbook
    • getAllPictures

      public List<? extends org.apache.poi.ss.usermodel.PictureData> getAllPictures()
      Stub returning an empty list for POI interface parity; pictures are not used in SPDX serializations.
      Specified by:
      getAllPictures in interface org.apache.poi.ss.usermodel.Workbook
    • getCreationHelper

      public org.apache.poi.ss.usermodel.CreationHelper getCreationHelper()
      Specified by:
      getCreationHelper in interface org.apache.poi.ss.usermodel.Workbook
    • isHidden

      public boolean isHidden()
      Specified by:
      isHidden in interface org.apache.poi.ss.usermodel.Workbook
    • setHidden

      public void setHidden(boolean hidden)
      Specified by:
      setHidden in interface org.apache.poi.ss.usermodel.Workbook
    • isSheetHidden

      public boolean isSheetHidden(int sheetNum)
      Specified by:
      isSheetHidden in interface org.apache.poi.ss.usermodel.Workbook
    • isSheetVeryHidden

      public boolean isSheetVeryHidden(int sheetNum)
      Specified by:
      isSheetVeryHidden in interface org.apache.poi.ss.usermodel.Workbook
    • setSheetHidden

      public void setSheetHidden(int sheetNum, boolean hidden)
      Specified by:
      setSheetHidden in interface org.apache.poi.ss.usermodel.Workbook
    • setSheetVisibility

      public void setSheetVisibility(int sheetNum, org.apache.poi.ss.usermodel.SheetVisibility visibility)
      Specified by:
      setSheetVisibility in interface org.apache.poi.ss.usermodel.Workbook
    • getSheetVisibility

      public org.apache.poi.ss.usermodel.SheetVisibility getSheetVisibility(int sheetNum)
      Specified by:
      getSheetVisibility in interface org.apache.poi.ss.usermodel.Workbook
    • addToolPack

      public void addToolPack(org.apache.poi.ss.formula.udf.UDFFinder toopack)
      Specified by:
      addToolPack in interface org.apache.poi.ss.usermodel.Workbook
    • setForceFormulaRecalculation

      public void setForceFormulaRecalculation(boolean value)
      Specified by:
      setForceFormulaRecalculation in interface org.apache.poi.ss.usermodel.Workbook
    • getForceFormulaRecalculation

      public boolean getForceFormulaRecalculation()
      Specified by:
      getForceFormulaRecalculation in interface org.apache.poi.ss.usermodel.Workbook
    • getSpreadsheetVersion

      public org.apache.poi.ss.SpreadsheetVersion getSpreadsheetVersion()
      Specified by:
      getSpreadsheetVersion in interface org.apache.poi.ss.usermodel.Workbook
    • iterator

      public Iterator<org.apache.poi.ss.usermodel.Sheet> iterator()
      Specified by:
      iterator in interface Iterable<org.apache.poi.ss.usermodel.Sheet>
      Specified by:
      iterator in interface org.apache.poi.ss.usermodel.Workbook
    • setCellReferenceType

      public void setCellReferenceType(org.apache.poi.ss.usermodel.CellReferenceType cellReferenceType)
      Specified by:
      setCellReferenceType in interface org.apache.poi.ss.usermodel.Workbook
    • getCellReferenceType

      public org.apache.poi.ss.usermodel.CellReferenceType getCellReferenceType()
      Specified by:
      getCellReferenceType in interface org.apache.poi.ss.usermodel.Workbook
    • addOlePackage

      public int addOlePackage(byte[] oleData, String label, String fileName, String command) throws IOException
      Specified by:
      addOlePackage in interface org.apache.poi.ss.usermodel.Workbook
      Throws:
      IOException
    • createEvaluationWorkbook

      public org.apache.poi.ss.formula.EvaluationWorkbook createEvaluationWorkbook()
      Specified by:
      createEvaluationWorkbook in interface org.apache.poi.ss.usermodel.Workbook
    • setMissingCellPolicy

      public void setMissingCellPolicy(org.apache.poi.ss.usermodel.Row.MissingCellPolicy missingCellPolicy)
      Specified by:
      setMissingCellPolicy in interface org.apache.poi.ss.usermodel.Workbook
    • getMissingCellPolicy

      public org.apache.poi.ss.usermodel.Row.MissingCellPolicy getMissingCellPolicy()
      Specified by:
      getMissingCellPolicy in interface org.apache.poi.ss.usermodel.Workbook
    • removePrintArea

      public void removePrintArea(int sheetIndex)
      Specified by:
      removePrintArea in interface org.apache.poi.ss.usermodel.Workbook
    • setPrintArea

      public void setPrintArea(int sheetIndex, String reference)
      Specified by:
      setPrintArea in interface org.apache.poi.ss.usermodel.Workbook
    • setPrintArea

      public void setPrintArea(int sheetIndex, int startColumn, int endColumn, int startRow, int endRow)
      Specified by:
      setPrintArea in interface org.apache.poi.ss.usermodel.Workbook
    • getPrintArea

      public String getPrintArea(int sheetIndex)
      Specified by:
      getPrintArea in interface org.apache.poi.ss.usermodel.Workbook
    • linkExternalWorkbook

      public int linkExternalWorkbook(String name, org.apache.poi.ss.usermodel.Workbook workbook)
      Specified by:
      linkExternalWorkbook in interface org.apache.poi.ss.usermodel.Workbook
    • getNumberOfNames

      public int getNumberOfNames()
      Specified by:
      getNumberOfNames in interface org.apache.poi.ss.usermodel.Workbook
    • getName

      public org.apache.poi.ss.usermodel.Name getName(String name)
      Specified by:
      getName in interface org.apache.poi.ss.usermodel.Workbook
    • getNames

      public List<? extends org.apache.poi.ss.usermodel.Name> getNames(String name)
      Specified by:
      getNames in interface org.apache.poi.ss.usermodel.Workbook
    • getAllNames

      public List<? extends org.apache.poi.ss.usermodel.Name> getAllNames()
      Specified by:
      getAllNames in interface org.apache.poi.ss.usermodel.Workbook
    • createName

      public org.apache.poi.ss.usermodel.Name createName()
      Specified by:
      createName in interface org.apache.poi.ss.usermodel.Workbook
    • removeName

      public void removeName(org.apache.poi.ss.usermodel.Name name)
      Specified by:
      removeName in interface org.apache.poi.ss.usermodel.Workbook
    • getNumberOfFontsAsInt

      public int getNumberOfFontsAsInt()
      Specified by:
      getNumberOfFontsAsInt in interface org.apache.poi.ss.usermodel.Workbook