Package adams.data.io.input
Class AbstractAdamsExperimentReader
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.io.input.AbstractAdamsExperimentReader
-
- 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:
JsonAdamsExperimentReader
,NestedAdamsExperimentReader
,SerializedAdamsExperimentReader
public abstract class AbstractAdamsExperimentReader extends adams.core.option.AbstractOptionHandler implements adams.core.io.FileFormatHandler
Ancestor for readers for ADAMS Experiments.- Version:
- $Revision$
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractAdamsExperimentReader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
check(adams.core.io.PlaceholderFile file)
Performs checks.protected abstract AbstractExperiment
doRead(adams.core.io.PlaceholderFile file)
Performs the actual reading of the experiment file.abstract AbstractAdamsExperimentWriter
getCorrespondingWriter()
Returns, if available, the corresponding writer.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[]
getReaders()
Returns a list with classes of readers.boolean
isAvailable()
Returns whether the reader is actually available.AbstractExperiment
read(adams.core.io.PlaceholderFile file)
Reads 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!)
-
getCorrespondingWriter
public abstract AbstractAdamsExperimentWriter getCorrespondingWriter()
Returns, if available, the corresponding writer.- Returns:
- the writer, null if none available
-
isAvailable
public boolean isAvailable()
Returns whether the reader is actually available.- Returns:
- true if available and ready to use
-
check
protected void check(adams.core.io.PlaceholderFile file)
Performs checks.- Parameters:
file
- the image file to check
-
doRead
protected abstract AbstractExperiment doRead(adams.core.io.PlaceholderFile file)
Performs the actual reading of the experiment file.- Parameters:
file
- the file to read- Returns:
- the experiment, null if failed to read
-
read
public AbstractExperiment read(adams.core.io.PlaceholderFile file)
Reads the experiment file.- Parameters:
file
- the file to read- Returns:
- the experiment, null if failed to read
-
getReaders
public static Class[] getReaders()
Returns a list with classes of readers.- Returns:
- the reader classes
-
-