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
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ExcelWriter()
Empty default constructor.ExcelWriter(File destinationFile)
Constructor. -
Method Summary
Modifier and Type Method Description void
addSeparator(WorkbookStyle textStyle)
Adds a separator.void
close()
Writes the content in cache and closes the connection to the file.void
decreseDepth()
Notifies the writer that data of a lower hierarchical depth will be written, e.g.org.apache.poi.hssf.usermodel.HSSFWorkbook
getWorkbook()
Return the workBook.WorkbookStyle
getWorkbookStyle()
Returns the workbook style.void
increaseDepth()
Notifies the writer that data of a higher hierarchical depth will be written, e.g.void
newLine()
Adds a separator.void
setWorkbookStyle(WorkbookStyle workbookStyle)
Sets the workbook style.void
startNewSection(String sectionTitle, WorkbookStyle textStyle)
Starts a new section.void
write(String text, WorkbookStyle textStyle)
Writes text to the export.void
writeHeaderText(String text, WorkbookStyle textStyle)
Writes header text to the export.void
writeMainTitle(String text, WorkbookStyle textStyle)
Writes the main title.Methods inherited from class com.compomics.util.io.export.ExportWriter
addSeparator, getExportFormat, getExportWriter, startNewSection, startNewSection, write, writeHeaderText, writeMainTitle
-
Constructor Details
-
ExcelWriter
public ExcelWriter()Empty default constructor. -
ExcelWriter
Constructor.- Parameters:
destinationFile
- the file where to write the data
-
-
Method Details
-
getWorkbookStyle
Returns the workbook style.- Returns:
- the workbook style
-
setWorkbookStyle
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
Description copied from class:ExportWriter
Writes text to the export.- Specified by:
write
in classExportWriter
- Parameters:
text
- the text to writetextStyle
- the style to use, overwrites any previous/default- Throws:
IOException
- if an IOException occurs
-
writeMainTitle
Description copied from class:ExportWriter
Writes the main title.- Specified by:
writeMainTitle
in classExportWriter
- Parameters:
text
- the text to writetextStyle
- the style to use, overwrites any previous/default- Throws:
IOException
- if an IOException occurs
-
startNewSection
Description copied from class:ExportWriter
Starts a new section.- Specified by:
startNewSection
in classExportWriter
- Parameters:
sectionTitle
- the text to writetextStyle
- the style to use, overwrites any previous/default- Throws:
IOException
- if an IOException occurs
-
writeHeaderText
Description copied from class:ExportWriter
Writes header text to the export.- Specified by:
writeHeaderText
in classExportWriter
- Parameters:
text
- the text to writetextStyle
- the style to use, overwrites any previous/default- Throws:
IOException
- if an IOException occurs
-
addSeparator
Description copied from class:ExportWriter
Adds a separator.- Specified by:
addSeparator
in classExportWriter
- Parameters:
textStyle
- the style to use, overwrites any previous/default- Throws:
IOException
- if an IOException occurs
-
newLine
Description copied from class:ExportWriter
Adds a separator.- Specified by:
newLine
in classExportWriter
- Throws:
IOException
- if an IOException occurs
-
close
Description copied from class:ExportWriter
Writes the content in cache and closes the connection to the file.- Specified by:
close
in classExportWriter
- Throws:
IOException
- if an IOException occursFileNotFoundException
- 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 classExportWriter
-
decreseDepth
public void decreseDepth()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:
decreseDepth
in classExportWriter
-