Class TextWriter
java.lang.Object
com.compomics.util.io.export.ExportWriter
com.compomics.util.io.export.writers.TextWriter
ExportWriter for the export to text files.
- Author:
- Marc Vaudel
-
Field Summary
Fields inherited from class com.compomics.util.io.export.ExportWriter
exportFormat, LAST_FOLDER_KEY -
Constructor Summary
ConstructorsConstructorDescriptionEmpty default constructorTextWriter(File destinationFile, String separator, int nSeparationLines, boolean gzip) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSeparator(WorkbookStyle textStyle) Adds a separator.voidclose()Writes the content in cache and closes the connection to the file.voidNotifies the writer that data of a lower hierarchical depth will be written, e.g.voidNotifies the writer that data of a higher hierarchical depth will be written, e.g.voidnewLine()Adds a separator.voidstartNewSection(String sectionTitle, WorkbookStyle textStyle) Starts a new section.voidwrite(String text, WorkbookStyle textStyle) Writes text to the export.voidwriteHeaderText(String text, WorkbookStyle textStyle) Writes header text to the export.voidwriteMainTitle(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
-
TextWriter
public TextWriter()Empty default constructor -
TextWriter
public TextWriter(File destinationFile, String separator, int nSeparationLines, boolean gzip) throws IOException Constructor.- Parameters:
destinationFile- the file where to write the reportseparator- separator between two valuesnSeparationLines- the number of lines to include between two sectionsgzip- if true export as gzipped file- Throws:
IOException- if an IOException occurs
-
-
Method Details
-
write
Description copied from class:ExportWriterWrites text to the export.- Specified by:
writein 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:ExportWriterWrites the main title.- Specified by:
writeMainTitlein 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:ExportWriterStarts a new section.- Specified by:
startNewSectionin 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:ExportWriterWrites header text to the export.- Specified by:
writeHeaderTextin 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:ExportWriterAdds a separator.- Specified by:
addSeparatorin classExportWriter- Parameters:
textStyle- the style to use, overwrites any previous/default- Throws:
IOException- if an IOException occurs
-
newLine
Description copied from class:ExportWriterAdds a separator.- Specified by:
newLinein classExportWriter- Throws:
IOException- if an IOException occurs
-
close
Description copied from class:ExportWriterWrites the content in cache and closes the connection to the file.- Specified by:
closein classExportWriter- Throws:
IOException- if an IOException occursFileNotFoundException- if a FileNotFoundException occurs
-
increaseDepth
public void increaseDepth()Description copied from class:ExportWriterNotifies the writer that data of a higher hierarchical depth will be written, e.g. going from protein to peptide.- Specified by:
increaseDepthin classExportWriter
-
decreaseDepth
public void decreaseDepth()Description copied from class:ExportWriterNotifies the writer that data of a lower hierarchical depth will be written, e.g. going from peptide to protein.- Specified by:
decreaseDepthin classExportWriter
-