Package adams.data.io.output
Class SimpleTimeseriesWriter
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,FileFormatHandler
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,ShallowCopySupporter<AbstractDataContainerWriter>
,SizeOfHandler
,Serializable
,Comparable
public class SimpleTimeseriesWriter extends AbstractTimeseriesWriter
Writer for the simply timeseries format, CSV-like with preceding comments.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DateFormatString
m_TimestampFormat
the date format string to use for formatting the timestamp.-
Fields inherited from class adams.data.io.output.AbstractDataContainerWriter
m_Output, m_OutputIsFile
-
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 SimpleTimeseriesWriter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
defineOptions()
Adds options to the internal list of options.String
getFormatDescription()
Returns a string describing the format (used in the file chooser).String[]
getFormatExtensions()
Returns the extension(s) of the format.DateFormatString
getTimestampFormat()
Returns the format to use for the timestamps.String
globalInfo()
Returns a string describing the object.void
setTimestampFormat(DateFormatString value)
Sets the format to use for the timestamps.String
timestampFormatTipText()
Returns the tip text for this property.protected boolean
writeData(List<Timeseries> data)
Performs the actual writing.-
Methods inherited from class adams.data.io.output.AbstractTimeseriesWriter
canWriteMultiple, getWriters, initialize
-
Methods inherited from class adams.data.io.output.AbstractDataContainerWriter
checkData, cleanUp, compareTo, destroy, equals, forCommandLine, forName, getAdditionalInformation, getDefaultFormatExtension, getOutput, isOutputFile, outputTipText, reset, setOutput, shallowCopy, shallowCopy, write, write
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, 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, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_TimestampFormat
protected DateFormatString m_TimestampFormat
the date format string to use for formatting the timestamp.
-
-
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 classAbstractDataContainerWriter<Timeseries>
-
getFormatDescription
public String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceFileFormatHandler
- Specified by:
getFormatDescription
in classAbstractDataContainerWriter<Timeseries>
- 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 interfaceFileFormatHandler
- Specified by:
getFormatExtensions
in classAbstractDataContainerWriter<Timeseries>
- Returns:
- the extension (without the dot!)
-
setTimestampFormat
public void setTimestampFormat(DateFormatString value)
Sets the format to use for the timestamps.- Parameters:
value
- the format
-
getTimestampFormat
public DateFormatString getTimestampFormat()
Returns the format to use for the timestamps.- Returns:
- the format
-
timestampFormatTipText
public String timestampFormatTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
writeData
protected boolean writeData(List<Timeseries> data)
Performs the actual writing.
Writes only the first timeseries to the file.- Specified by:
writeData
in classAbstractDataContainerWriter<Timeseries>
- Parameters:
data
- the data to write- Returns:
- true if successfully written
-
-