Class 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.
      • Fields inherited from class adams.core.option.AbstractOptionHandler

        m_OptionManager
      • Fields inherited from class adams.core.logging.LoggingObject

        m_Logger, m_LoggingIsEnabled, m_LoggingLevel
    • 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
      • Methods inherited from interface adams.core.logging.LoggingLevelHandler

        getLoggingLevel
    • Field Detail

      • m_FileChooser

        protected adams.gui.chooser.BaseFileChooser m_FileChooser
        the filechooser for experiments.
    • Constructor Detail

      • AbstractExperimentIO

        public AbstractExperimentIO()
    • 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 save
        file - the file to save to
        Returns:
        false if failed to save
      • 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)