Package adams.data.io.output
Class GnumericSpreadSheetWriter
-
- All Implemented Interfaces:
AdditionalInformationHandler
,Destroyable
,GlobalInfoSupporter
,EncodingSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,MultiSheetSpreadSheetWriter
,SpreadSheetWriter
,Serializable
public class GnumericSpreadSheetWriter extends AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
Writes Gnumeric workbook files (GZIP compressed or uncompressed XML), version 1.10.13.
Valid options are:
-D <int> (property: debugLevel) The greater the number the more additional info the scheme may output to the console (0 = off). default: 0 minimum: 0
-sheet-prefix <java.lang.String> (property: sheetPrefix) The prefix for sheet names. default: Sheet
-missing <java.lang.String> (property: missingValue) The placeholder for missing values. default:
-creation-timestamp <adams.core.base.BaseDateTime> (property: creationTimestamp) The timestamp to use as creation date/time info in the file. default: NOW
-uncompressed (property: uncompressedOutput) If enabled, uncompressed XML instead of GZIP compressed output is generated.
- Version:
- $Revision$
- 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 BaseDateTime
m_CreationTimestamp
the creation timestamp.protected boolean
m_UncompressedOutput
whether to use uncompressed output.static String
VALUETYPE_NUMERIC
numeric cells.static String
VALUETYPE_STRING
string cells.static String
VERSION
the complete version.static String
VERSION_MAJOR
the major version.static String
VERSION_MINOR
the minor version.static String
VERSION_REVISION
the revision version.-
Fields inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
m_MissingValue
-
Fields inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriter
m_SheetPrefix
-
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 GnumericSpreadSheetWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
creationTimestampTipText()
Returns the tip text for this property.void
defineOptions()
Adds options to the internal list of options.protected boolean
doWrite(SpreadSheet[] content, OutputStream out)
Performs the actual writing.protected long
getBound(SpreadSheet content, boolean cols)
Returns the integer bound for number of columns/rows.SpreadSheetReader
getCorrespondingReader()
Returns, if available, the corresponding reader.BaseDateTime
getCreationTimestamp()
Returns the creation timestamp.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.protected AbstractSpreadSheetWriter.OutputType
getOutputType()
Returns how the data is written.boolean
getUncompressedOutput()
Returns whether to output uncompressed XML.String
globalInfo()
Returns a string describing the object.void
setCreationTimestamp(BaseDateTime value)
Sets the creation timestamp.void
setUncompressedOutput(boolean value)
Sets whether to output uncompressed XML.String
uncompressedOutputTipText()
Returns the tip text for this property.-
Methods inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
getDefaultMissingValue, getMissingValue, missingValueTipText, setMissingValue
-
Methods inherited from class adams.data.io.output.AbstractMultiSheetSpreadSheetWriter
canWriteMultiple, doWrite, doWrite, doWrite, doWrite, getDefaultSheetPrefix, getSheetPrefix, setSheetPrefix, sheetPrefixTipText, write, write, write, write
-
Methods inherited from class adams.data.io.output.AbstractSpreadSheetWriter
canCompress, doWrite, encodingTipText, getAdditionalInformation, getDefaultFormatExtension, getEncoding, 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, 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
reset, write, write, write, write
-
Methods inherited from interface adams.core.Stoppable
stopExecution
-
Methods inherited from interface adams.core.StoppableWithFeedback
isStopped
-
-
-
-
Field Detail
-
VERSION_MAJOR
public static final String VERSION_MAJOR
the major version.- See Also:
- Constant Field Values
-
VERSION_MINOR
public static final String VERSION_MINOR
the minor version.- See Also:
- Constant Field Values
-
VERSION_REVISION
public static final String VERSION_REVISION
the revision version.- See Also:
- Constant Field Values
-
VERSION
public static final String VERSION
the complete version.- See Also:
- Constant Field Values
-
VALUETYPE_NUMERIC
public static final String VALUETYPE_NUMERIC
numeric cells.- See Also:
- Constant Field Values
-
VALUETYPE_STRING
public static final String VALUETYPE_STRING
string cells.- See Also:
- Constant Field Values
-
m_CreationTimestamp
protected BaseDateTime m_CreationTimestamp
the creation timestamp.
-
m_UncompressedOutput
protected boolean m_UncompressedOutput
whether to use uncompressed output.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractMultiSheetSpreadSheetWriterWithMissingValueSupport
-
setCreationTimestamp
public void setCreationTimestamp(BaseDateTime value)
Sets the creation timestamp.- Parameters:
value
- the timestamp
-
getCreationTimestamp
public BaseDateTime getCreationTimestamp()
Returns the creation timestamp.- Returns:
- the timestamp
-
creationTimestampTipText
public String creationTimestampTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setUncompressedOutput
public void setUncompressedOutput(boolean value)
Sets whether to output uncompressed XML.- Parameters:
value
- if true uncompressed XML is generated
-
getUncompressedOutput
public boolean getUncompressedOutput()
Returns whether to output uncompressed XML.- Returns:
- true if uncompressed XML is generated
-
uncompressedOutputTipText
public String uncompressedOutputTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceSpreadSheetWriter
- Specified by:
getFormatDescription
in classAbstractSpreadSheetWriter
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceSpreadSheetWriter
- Specified by:
getFormatExtensions
in classAbstractSpreadSheetWriter
- Returns:
- the extension (without the dot!)
-
getCorrespondingReader
public SpreadSheetReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Returns:
- the reader, null if none available
-
getOutputType
protected AbstractSpreadSheetWriter.OutputType getOutputType()
Returns how the data is written.- Specified by:
getOutputType
in classAbstractSpreadSheetWriter
- Returns:
- the type
-
getBound
protected long getBound(SpreadSheet content, boolean cols)
Returns the integer bound for number of columns/rows.- Parameters:
content
- the sheet to use as basiscols
- if true columns are checked, otherwise rows- Returns:
- the bound (base 256)
-
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 classAbstractMultiSheetSpreadSheetWriter
- Parameters:
content
- the spreadsheets to writeout
- the output stream to write the spreadsheet to- Returns:
- true if successfully written
-
-