Package adams.data.io.output
Class AbstractMultiSheetSpreadSheetWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractSpreadSheetWriter
-
- adams.data.io.output.AbstractMultiSheetSpreadSheetWriter
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,EncodingSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,MultiSheetSpreadSheetWriter
,SpreadSheetWriter
,Serializable
- Direct Known Subclasses:
AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
,Mat5SpreadSheetWriter
public abstract class AbstractMultiSheetSpreadSheetWriter extends AbstractSpreadSheetWriter implements MultiSheetSpreadSheetWriter
Ancestor for spreadsheet writers that can write multiple sheets into a single document.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class adams.data.io.output.AbstractSpreadSheetWriter
AbstractSpreadSheetWriter.OutputType
-
-
Field Summary
Fields Modifier and Type Field Description protected String
m_SheetPrefix
The prefix for the sheet names.-
Fields inherited from class adams.data.io.output.AbstractSpreadSheetWriter
m_Encoding, m_Stopped
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description AbstractMultiSheetSpreadSheetWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canWriteMultiple()
Returns whether the writer supports writing multiple sheets.void
defineOptions()
Adds options to the internal list of options.protected boolean
doWrite(SpreadSheet[] content, OutputStream out)
Performs the actual writing.protected boolean
doWrite(SpreadSheet[] content, Writer writer)
Performs the actual writing.protected boolean
doWrite(SpreadSheet[] content, String filename)
Performs the actual writing.protected boolean
doWrite(SpreadSheet content, OutputStream out)
Performs the actual writing.protected boolean
doWrite(SpreadSheet content, Writer writer)
Performs the actual writing.protected String
getDefaultSheetPrefix()
Returns the default missing value.String
getSheetPrefix()
Returns the prefix for sheet namesvoid
setSheetPrefix(String value)
Sets the prefix for sheet names.String
sheetPrefixTipText()
Returns the tip text for this property.boolean
write(SpreadSheet[] content, File file)
Writes the spreadsheets to the specified file.boolean
write(SpreadSheet[] content, OutputStream stream)
Writes the spreadsheets to the given output stream.boolean
write(SpreadSheet[] content, Writer writer)
Writes the spreadsheets to the given writer.boolean
write(SpreadSheet[] content, String filename)
Writes the spreadsheets to the given file.-
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter
canCompress, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, getFormatDescription, getFormatExtensions, getOutputType, getWriters, initialize, isStopped, preWriteFile, reset, setEncoding, stopExecution, supportsCompressedOutput, write, write, write, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.Destroyable
destroy
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager, toCommandLine
-
Methods inherited from interface adams.data.io.output.SpreadSheetWriter
getCorrespondingReader, getFormatDescription, getFormatExtensions, reset, write, write, write, write
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
m_SheetPrefix
protected String m_SheetPrefix
The prefix for the sheet names.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
getDefaultSheetPrefix
protected String getDefaultSheetPrefix()
Returns the default missing value.- Returns:
- the default for missing values
-
setSheetPrefix
public void setSheetPrefix(String value)
Sets the prefix for sheet names.- Parameters:
value
- the prefix
-
getSheetPrefix
public String getSheetPrefix()
Returns the prefix for sheet names- Returns:
- the prefix
-
sheetPrefixTipText
public String sheetPrefixTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
canWriteMultiple
public boolean canWriteMultiple()
Returns whether the writer supports writing multiple sheets.- Specified by:
canWriteMultiple
in interfaceMultiSheetSpreadSheetWriter
- Returns:
- true if it can write multiple sheets
-
doWrite
protected boolean doWrite(SpreadSheet content, Writer writer)
Performs the actual writing. The caller must ensure that the writer gets closed.- Overrides:
doWrite
in classAbstractSpreadSheetWriter
- Parameters:
content
- the spreadsheet to writewriter
- the writer to write the spreadsheet to- Returns:
- true if successfully written
-
doWrite
protected boolean doWrite(SpreadSheet content, OutputStream out)
Performs the actual writing. The caller must ensure that the output stream gets closed.- Overrides:
doWrite
in classAbstractSpreadSheetWriter
- Parameters:
content
- the spreadsheet to writeout
- the output stream to write the spreadsheet to- Returns:
- true if successfully written
-
doWrite
protected boolean doWrite(SpreadSheet[] content, String filename)
Performs the actual writing. The caller must ensure that the writer gets closed.
Default implementation returns always false.- Parameters:
content
- the spreadsheet to writefilename
- the file to write the spreadsheet to- Returns:
- true if successfully written
-
doWrite
protected boolean doWrite(SpreadSheet[] content, Writer writer)
Performs the actual writing. The caller must ensure that the writer gets closed.
Default implementation returns always false.- Parameters:
content
- the spreadsheet to writewriter
- the writer to write the spreadsheet to- Returns:
- true if successfully written
-
doWrite
protected boolean doWrite(SpreadSheet[] content, OutputStream out)
Performs the actual writing. The caller must ensure that the output stream gets closed.
Default implementation returns always false.- Parameters:
content
- the spreadsheet to writeout
- the output stream to write the spreadsheet to- Returns:
- true if successfully written
-
write
public boolean write(SpreadSheet[] content, File file)
Writes the spreadsheets to the specified file.- Specified by:
write
in interfaceMultiSheetSpreadSheetWriter
- Parameters:
content
- the content to writefile
- the file to write to- Returns:
- true if successfully written
-
write
public boolean write(SpreadSheet[] content, String filename)
Writes the spreadsheets to the given file.- Specified by:
write
in interfaceMultiSheetSpreadSheetWriter
- Parameters:
content
- the spreadsheet to writefilename
- the file to write the spreadsheet to- Returns:
- true if successfully written
-
write
public boolean write(SpreadSheet[] content, OutputStream stream)
Writes the spreadsheets to the given output stream. The caller must ensure that the stream gets closed.- Specified by:
write
in interfaceMultiSheetSpreadSheetWriter
- Parameters:
content
- the spreadsheet to writestream
- the output stream to write the spreadsheet to- Returns:
- true if successfully written
-
write
public boolean write(SpreadSheet[] content, Writer writer)
Writes the spreadsheets to the given writer. The caller must ensure that the writer gets closed.- Specified by:
write
in interfaceMultiSheetSpreadSheetWriter
- Parameters:
content
- the spreadsheet to writewriter
- the writer to write the spreadsheet to- Returns:
- true if successfully written
-
-