Class ExcelWriter

java.lang.Object
com.compomics.util.io.export.ExportWriter
com.compomics.util.io.export.writers.ExcelWriter

public class ExcelWriter extends ExportWriter
ExportWriter for the export to Excel files.
Author:
Marc Vaudel
  • Constructor Details

    • ExcelWriter

      public ExcelWriter()
      Empty default constructor.
    • ExcelWriter

      public ExcelWriter(File destinationFile)
      Constructor.
      Parameters:
      destinationFile - the file where to write the data
  • Method Details

    • getWorkbookStyle

      public WorkbookStyle getWorkbookStyle()
      Returns the workbook style.
      Returns:
      the workbook style
    • setWorkbookStyle

      public void setWorkbookStyle(WorkbookStyle workbookStyle)
      Sets the workbook style.
      Parameters:
      workbookStyle - the workbook style
    • getWorkbook

      public org.apache.poi.hssf.usermodel.HSSFWorkbook getWorkbook()
      Return the workBook.
      Returns:
      the workBook
    • write

      public void write(String text, WorkbookStyle textStyle) throws IOException
      Description copied from class: ExportWriter
      Writes text to the export.
      Specified by:
      write in class ExportWriter
      Parameters:
      text - the text to write
      textStyle - the style to use, overwrites any previous/default
      Throws:
      IOException - if an IOException occurs
    • writeMainTitle

      public void writeMainTitle(String text, WorkbookStyle textStyle) throws IOException
      Description copied from class: ExportWriter
      Writes the main title.
      Specified by:
      writeMainTitle in class ExportWriter
      Parameters:
      text - the text to write
      textStyle - the style to use, overwrites any previous/default
      Throws:
      IOException - if an IOException occurs
    • startNewSection

      public void startNewSection(String sectionTitle, WorkbookStyle textStyle) throws IOException
      Description copied from class: ExportWriter
      Starts a new section.
      Specified by:
      startNewSection in class ExportWriter
      Parameters:
      sectionTitle - the text to write
      textStyle - the style to use, overwrites any previous/default
      Throws:
      IOException - if an IOException occurs
    • writeHeaderText

      public void writeHeaderText(String text, WorkbookStyle textStyle) throws IOException
      Description copied from class: ExportWriter
      Writes header text to the export.
      Specified by:
      writeHeaderText in class ExportWriter
      Parameters:
      text - the text to write
      textStyle - the style to use, overwrites any previous/default
      Throws:
      IOException - if an IOException occurs
    • addSeparator

      public void addSeparator(WorkbookStyle textStyle) throws IOException
      Description copied from class: ExportWriter
      Adds a separator.
      Specified by:
      addSeparator in class ExportWriter
      Parameters:
      textStyle - the style to use, overwrites any previous/default
      Throws:
      IOException - if an IOException occurs
    • newLine

      public void newLine() throws IOException
      Description copied from class: ExportWriter
      Adds a separator.
      Specified by:
      newLine in class ExportWriter
      Throws:
      IOException - if an IOException occurs
    • close

      public void close() throws IOException, FileNotFoundException
      Description copied from class: ExportWriter
      Writes the content in cache and closes the connection to the file.
      Specified by:
      close in class ExportWriter
      Throws:
      IOException - if an IOException occurs
      FileNotFoundException - if a FileNotFoundException occurs
    • increaseDepth

      public void increaseDepth()
      Description copied from class: ExportWriter
      Notifies the writer that data of a higher hierarchical depth will be written, e.g. going from protein to peptide.
      Specified by:
      increaseDepth in class ExportWriter
    • decreaseDepth

      public void decreaseDepth()
      Description copied from class: ExportWriter
      Notifies the writer that data of a lower hierarchical depth will be written, e.g. going from peptide to protein.
      Specified by:
      decreaseDepth in class ExportWriter