Class AbstractSerializableFilter

  • All Implemented Interfaces:
    adams.core.CleanUpHandler, adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.SerializableObject, adams.core.ShallowCopySupporter<adams.data.filter.Filter>, adams.core.SizeOfHandler, adams.data.filter.Filter<Spectrum>, Serializable, Comparable

    public abstract class AbstractSerializableFilter
    extends adams.data.filter.AbstractFilter<Spectrum>
    implements adams.core.SerializableObject
    Abstract cleaner that can serialize its setup to disk and also load it from there.
    Version:
    $Revision: 2242 $
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class adams.data.filter.AbstractFilter

        adams.data.filter.AbstractFilter.FilterJob<T extends adams.data.container.DataContainer>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected boolean m_OverrideSerializationFile
      whether to override the file to serialize the setup to .
      protected adams.core.SerializableObjectHelper m_SerializableObjectHelper
      the helper class for serializing.
      protected adams.core.io.PlaceholderFile m_SerializationFile
      the file to serialize the setup to .
      • Fields inherited from class adams.data.filter.AbstractFilter

        m_DontUpdateID
      • 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 Concrete Methods 
      Modifier and Type Method Description
      protected void checkData​(Spectrum data)
      Loads the serialized data on demand in addition to the checks.
      void defineOptions()
      Adds options to the internal list of options.
      void destroy()
      Frees up memory in a "destructive" non-reversible way.
      boolean getOverrideSerializedFile()
      Returns whether to override an existing serialized setup.
      adams.core.io.PlaceholderFile getSerializationFile()
      Returns the current file to serialize to.
      protected void initialize()
      Initializes the members.
      boolean isSetupLoadedOrGenerated()
      Returns whether the setup was loaded/generated.
      String overrideSerializedFileTipText()
      Returns the tip text for this property.
      void reset()
      Resets the scheme.
      String serializationFileTipText()
      Returns the tip text for this property.
      void setOverrideSerializedFile​(boolean value)
      Sets whether to override an existing serialized setup.
      void setSerializationFile​(adams.core.io.PlaceholderFile value)
      Sets the file to serialize to.
      void setSetupLoadedOrGenerated​(boolean value)
      Sets whether the setup was loaded/generated.
      • Methods inherited from class adams.data.filter.AbstractFilter

        cleanUp, compareTo, dontUpdateIDTipText, equals, filter, forCommandLine, getDontUpdateID, processData, setDontUpdateID, shallowCopy, shallowCopy
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, 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, setLoggingLevel
      • Methods inherited from interface adams.core.logging.LoggingSupporter

        getLogger, isLoggingEnabled
      • Methods inherited from interface adams.core.option.OptionHandler

        cleanUpOptions, getOptionManager, toCommandLine
      • Methods inherited from interface adams.core.SerializableObject

        initSerializationSetup, retrieveSerializationSetup, setSerializationSetup
    • Field Detail

      • m_SerializationFile

        protected adams.core.io.PlaceholderFile m_SerializationFile
        the file to serialize the setup to .
      • m_OverrideSerializationFile

        protected boolean m_OverrideSerializationFile
        whether to override the file to serialize the setup to .
      • m_SerializableObjectHelper

        protected adams.core.SerializableObjectHelper m_SerializableObjectHelper
        the helper class for serializing.
    • Constructor Detail

      • AbstractSerializableFilter

        public AbstractSerializableFilter()
    • Method Detail

      • defineOptions

        public void defineOptions()
        Adds options to the internal list of options.
        Specified by:
        defineOptions in interface adams.core.option.OptionHandler
        Overrides:
        defineOptions in class adams.data.filter.AbstractFilter<Spectrum>
      • initialize

        protected void initialize()
        Initializes the members.
        Overrides:
        initialize in class adams.core.option.AbstractOptionHandler
      • reset

        public void reset()
        Resets the scheme.
        Specified by:
        reset in interface adams.data.filter.Filter<Spectrum>
        Overrides:
        reset in class adams.data.filter.AbstractFilter<Spectrum>
      • setSerializationFile

        public void setSerializationFile​(adams.core.io.PlaceholderFile value)
        Sets the file to serialize to.
        Specified by:
        setSerializationFile in interface adams.core.SerializableObject
        Parameters:
        value - the file
      • getSerializationFile

        public adams.core.io.PlaceholderFile getSerializationFile()
        Returns the current file to serialize to.
        Specified by:
        getSerializationFile in interface adams.core.SerializableObject
        Returns:
        the file
      • serializationFileTipText

        public String serializationFileTipText()
        Returns the tip text for this property.
        Specified by:
        serializationFileTipText in interface adams.core.SerializableObject
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setOverrideSerializedFile

        public void setOverrideSerializedFile​(boolean value)
        Sets whether to override an existing serialized setup.
        Specified by:
        setOverrideSerializedFile in interface adams.core.SerializableObject
        Parameters:
        value - true if to override existing setup
      • getOverrideSerializedFile

        public boolean getOverrideSerializedFile()
        Returns whether to override an existing serialized setup.
        Specified by:
        getOverrideSerializedFile in interface adams.core.SerializableObject
        Returns:
        true if existing file is ignored
      • overrideSerializedFileTipText

        public String overrideSerializedFileTipText()
        Returns the tip text for this property.
        Specified by:
        overrideSerializedFileTipText in interface adams.core.SerializableObject
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setSetupLoadedOrGenerated

        public void setSetupLoadedOrGenerated​(boolean value)
        Sets whether the setup was loaded/generated.
        Specified by:
        setSetupLoadedOrGenerated in interface adams.core.SerializableObject
        Parameters:
        value - true if loaded/generated
      • isSetupLoadedOrGenerated

        public boolean isSetupLoadedOrGenerated()
        Returns whether the setup was loaded/generated.
        Specified by:
        isSetupLoadedOrGenerated in interface adams.core.SerializableObject
        Returns:
        true if loaded/generated
      • checkData

        protected void checkData​(Spectrum data)
        Loads the serialized data on demand in addition to the checks.
        Overrides:
        checkData in class adams.data.filter.AbstractFilter<Spectrum>
        Parameters:
        data - the data to process
      • destroy

        public void destroy()
        Frees up memory in a "destructive" non-reversible way.

        Destroys the SerializableObjectHelper instance.
        Specified by:
        destroy in interface adams.core.Destroyable
        Specified by:
        destroy in interface adams.data.filter.Filter<Spectrum>
        Overrides:
        destroy in class adams.data.filter.AbstractFilter<Spectrum>