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 Stringm_SheetPrefixThe 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 booleancanWriteMultiple()Returns whether the writer supports writing multiple sheets.voiddefineOptions()Adds options to the internal list of options.protected booleandoWrite(SpreadSheet[] content, OutputStream out)Performs the actual writing.protected booleandoWrite(SpreadSheet[] content, Writer writer)Performs the actual writing.protected booleandoWrite(SpreadSheet[] content, String filename)Performs the actual writing.protected booleandoWrite(SpreadSheet content, OutputStream out)Performs the actual writing.protected booleandoWrite(SpreadSheet content, Writer writer)Performs the actual writing.protected StringgetDefaultSheetPrefix()Returns the default missing value.StringgetSheetPrefix()Returns the prefix for sheet namesvoidsetSheetPrefix(String value)Sets the prefix for sheet names.StringsheetPrefixTipText()Returns the tip text for this property.booleanwrite(SpreadSheet[] content, File file)Writes the spreadsheets to the specified file.booleanwrite(SpreadSheet[] content, OutputStream stream)Writes the spreadsheets to the given output stream.booleanwrite(SpreadSheet[] content, Writer writer)Writes the spreadsheets to the given writer.booleanwrite(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:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
canWriteMultiplein 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:
doWritein 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:
doWritein 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:
writein 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:
writein 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:
writein 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:
writein interfaceMultiSheetSpreadSheetWriter- Parameters:
content- the spreadsheet to writewriter- the writer to write the spreadsheet to- Returns:
- true if successfully written
-
-