Class 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
    • Field Summary

      • 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 Detail

      • AbstractAdamsExperimentReader

        public AbstractAdamsExperimentReader()
    • Method Detail

      • getFormatDescription

        public abstract String getFormatDescription()
        Returns a string describing the format (used in the file chooser).
        Specified by:
        getFormatDescription in interface adams.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 interface adams.core.io.FileFormatHandler
        Returns:
        the extension (without the dot!)
      • getDefaultFormatExtension

        public String getDefaultFormatExtension()
        Returns the default extension of the format.
        Specified by:
        getDefaultFormatExtension in interface adams.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