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 BaseDateTimem_CreationTimestampthe creation timestamp.protected booleanm_UncompressedOutputwhether to use uncompressed output.static StringVALUETYPE_NUMERICnumeric cells.static StringVALUETYPE_STRINGstring cells.static StringVERSIONthe complete version.static StringVERSION_MAJORthe major version.static StringVERSION_MINORthe minor version.static StringVERSION_REVISIONthe 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 StringcreationTimestampTipText()Returns the tip text for this property.voiddefineOptions()Adds options to the internal list of options.protected booleandoWrite(SpreadSheet[] content, OutputStream out)Performs the actual writing.protected longgetBound(SpreadSheet content, boolean cols)Returns the integer bound for number of columns/rows.SpreadSheetReadergetCorrespondingReader()Returns, if available, the corresponding reader.BaseDateTimegetCreationTimestamp()Returns the creation timestamp.StringgetFormatDescription()Returns a string describing the format (used in the file chooser).String[]getFormatExtensions()Returns the extension(s) of the format.protected AbstractSpreadSheetWriter.OutputTypegetOutputType()Returns how the data is written.booleangetUncompressedOutput()Returns whether to output uncompressed XML.StringglobalInfo()Returns a string describing the object.voidsetCreationTimestamp(BaseDateTime value)Sets the creation timestamp.voidsetUncompressedOutput(boolean value)Sets whether to output uncompressed XML.StringuncompressedOutputTipText()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:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin 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:
getFormatDescriptionin interfaceSpreadSheetWriter- Specified by:
getFormatDescriptionin classAbstractSpreadSheetWriter- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensionsin interfaceSpreadSheetWriter- Specified by:
getFormatExtensionsin 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:
getOutputTypein 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:
doWritein classAbstractMultiSheetSpreadSheetWriter- Parameters:
content- the spreadsheets to writeout- the output stream to write the spreadsheet to- Returns:
- true if successfully written
-
-