Class AbstractExperimentIO<T>
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.gui.tools.wekamultiexperimenter.io.AbstractExperimentIO<T>
-
- Type Parameters:
T
- the type of experiment
- All Implemented Interfaces:
adams.core.Destroyable
,adams.core.GlobalInfoSupporter
,adams.core.logging.LoggingLevelHandler
,adams.core.logging.LoggingSupporter
,adams.core.option.OptionHandler
,adams.core.SizeOfHandler
,Serializable
- Direct Known Subclasses:
AbstractAdamsExperimentIO
,AbstractWekaExperimentIO
public abstract class AbstractExperimentIO<T> extends adams.core.option.AbstractOptionHandler
Ancestor for classes that handle loading/saving of experiments.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected adams.gui.chooser.BaseFileChooser
m_FileChooser
the filechooser for experiments.
-
Constructor Summary
Constructors Constructor Description AbstractExperimentIO()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract T
create()
Creates a new experiment.protected abstract adams.gui.chooser.BaseFileChooser
createFileChooser()
Creates and returns a file chooser for loading/saving experiments.abstract AbstractExperimentRunner
createRunner(ExperimenterPanel owner)
Creates an experiment runner thread object.abstract Class
getExperimentClass()
Returns the experiment superclass/interface.adams.gui.chooser.BaseFileChooser
getFileChooser()
Returns the file chooser to use.abstract String[]
getSupportedFileExtensions(boolean read)
Returns the supported file extensions.abstract T
load(File file)
Loads an experiment.abstract boolean
save(T exp, File file)
Saves an experiment.-
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
-
createFileChooser
protected abstract adams.gui.chooser.BaseFileChooser createFileChooser()
Creates and returns a file chooser for loading/saving experiments.- Returns:
- the file chooser
-
getFileChooser
public adams.gui.chooser.BaseFileChooser getFileChooser()
Returns the file chooser to use.- Returns:
- the file chooser
-
create
public abstract T create()
Creates a new experiment.- Returns:
- the generated experiment, null if failed
-
load
public abstract T load(File file)
Loads an experiment.- Parameters:
file
- the file to load- Returns:
- the experiment, null if failed to load
-
save
public abstract boolean save(T exp, File file)
Saves an experiment.- Parameters:
exp
- the experiment to savefile
- the file to save to- Returns:
- false if failed to save
-
createRunner
public abstract AbstractExperimentRunner createRunner(ExperimenterPanel owner) throws Exception
Creates an experiment runner thread object.- Parameters:
owner
- the owning experimenter- Returns:
- the runner
- Throws:
Exception
- if failed to instantiate runner
-
getExperimentClass
public abstract Class getExperimentClass()
Returns the experiment superclass/interface.- Returns:
- the super class/interface
-
getSupportedFileExtensions
public abstract String[] getSupportedFileExtensions(boolean read)
Returns the supported file extensions.- Parameters:
read
- whether for reading or writing- Returns:
- the extensions (no dot)
-
-