Package adams.data.io.output
Class AbstractAdamsExperimentWriter
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.output.AbstractAdamsExperimentWriter
-
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.io.FileFormatHandler
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,Serializable
- Direct Known Subclasses:
JsonAdamsExperimentWriter
,NestedAdamsExperimentWriter
,SerializedAdamsExperimentWriter
public abstract class AbstractAdamsExperimentWriter extends adams.core.option.AbstractOptionHandler implements adams.core.io.FileFormatHandler
Ancestor for ADAMS Experiment writers.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractAdamsExperimentWriter()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check(AbstractExperiment exp)
Performs checks.protected abstract String
doWrite(adams.core.io.PlaceholderFile file, AbstractExperiment exp)
Performs the actual writing of the experiment file.abstract AbstractAdamsExperimentReader
getCorrespondingReader()
Returns, if available, the corresponding reader.String
getDefaultFormatExtension()
Returns the default extension of the format.abstract String
getFormatDescription()
Returns a string describing the format (used in the file chooser).abstract String[]
getFormatExtensions()
Returns the extension(s) of the format.static Class[]
getWriters()
Returns a list with classes of writers.boolean
isAvailable()
Returns whether the writer is actually available.String
write(adams.core.io.PlaceholderFile file, AbstractExperiment exp)
Writes the experiment file.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Method Detail
-
getFormatDescription
public abstract String getFormatDescription()
Returns a string describing the format (used in the file chooser).- Specified by:
getFormatDescription
in interfaceadams.core.io.FileFormatHandler
- Returns:
- a description suitable for displaying in the file chooser
-
getFormatExtensions
public abstract String[] getFormatExtensions()
Returns the extension(s) of the format.- Specified by:
getFormatExtensions
in interfaceadams.core.io.FileFormatHandler
- Returns:
- the extension (without the dot!)
-
getDefaultFormatExtension
public String getDefaultFormatExtension()
Returns the default extension of the format.- Specified by:
getDefaultFormatExtension
in interfaceadams.core.io.FileFormatHandler
- Returns:
- the default extension (without the dot!)
-
getCorrespondingReader
public abstract AbstractAdamsExperimentReader getCorrespondingReader()
Returns, if available, the corresponding reader.- Returns:
- the reader, null if none available
-
isAvailable
public boolean isAvailable()
Returns whether the writer is actually available.- Returns:
- true if available and ready to use
-
check
protected void check(AbstractExperiment exp)
Performs checks.- Parameters:
exp
- the experiment to check
-
doWrite
protected abstract String doWrite(adams.core.io.PlaceholderFile file, AbstractExperiment exp)
Performs the actual writing of the experiment file.- Parameters:
file
- the file to write toexp
- the experiment to write- Returns:
- null if successfully written, otherwise error message
-
write
public String write(adams.core.io.PlaceholderFile file, AbstractExperiment exp)
Writes the experiment file.- Parameters:
file
- the file to write toexp
- the experiment to write- Returns:
- null if successfully written, otherwise error message
-
getWriters
public static Class[] getWriters()
Returns a list with classes of writers.- Returns:
- the writer classes
-
-