Class HasSpectrum

  • All Implemented Interfaces:
    adams.core.Destroyable, adams.core.GlobalInfoSupporter, adams.core.logging.LoggingLevelHandler, adams.core.logging.LoggingSupporter, adams.core.option.OptionHandler, adams.core.QuickInfoSupporter, adams.core.ShallowCopySupporter<adams.flow.condition.bool.BooleanCondition>, adams.core.SizeOfHandler, adams.core.Stoppable, adams.db.DatabaseConnectionHandler, adams.db.DatabaseConnectionProvider, adams.db.DatabaseConnectionUser, adams.flow.condition.bool.BooleanCondition, Serializable

    public class HasSpectrum
    extends adams.flow.condition.bool.AbstractBooleanDatabaseCondition
    Checks whether a spectrum with either the specified ID or the ID from the passing through ID handler is already present in the database.
    A specified ID takes precedence of any ID of the token passing through.

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
     
    -id <java.lang.String> (property: ID)
        The (optional) ID of the spectrum to look for, if not obtained from the 
        passing through ID handler.
        default: 
     
    -format <java.lang.String> (property: format)
        The data format string.
        default: NIR
     
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected String m_Format
      the form of this data.
      protected String m_ID
      the ID of the spectrum.
      • Fields inherited from class adams.flow.condition.bool.AbstractBooleanDatabaseCondition

        m_DatabaseConnection, m_DatabaseConnectionUpdated
      • 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 Summary

      Constructors 
      Constructor Description
      HasSpectrum()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Class[] accepts()
      Returns the class that the consumer accepts.
      void defineOptions()
      Adds options to the internal list of options.
      protected boolean doEvaluate​(adams.flow.core.Actor owner, adams.flow.core.Token token)
      Performs the actual evaluation.
      String formatTipText()
      Returns the tip text for this property.
      protected String getDefaultFormat()
      Returns the default format of the spectra.
      String getFormat()
      Returns the format string of the data.
      String getID()
      Returns the ID to look, if not obtained from the passing through ID handler.
      String getQuickInfo()
      Returns the quick info string to be displayed in the flow editor.
      String globalInfo()
      Returns a string describing the object.
      String IDTipText()
      Returns the tip text for this property.
      void setFormat​(String value)
      Sets the format string of the data (always converted to upper case).
      void setID​(String value)
      Sets the ID to look, if not obtained from the passing through ID handler.
      • Methods inherited from class adams.flow.condition.bool.AbstractBooleanDatabaseCondition

        getConnection, getDatabaseConnection, getDefaultDatabaseConnection, initialize, preEvaluate, reset, setDatabaseConnection
      • Methods inherited from class adams.flow.condition.bool.AbstractBooleanCondition

        evaluate, setUp, shallowCopy, shallowCopy, stopExecution
      • Methods inherited from class adams.core.option.AbstractOptionHandler

        cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, 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
    • Field Detail

      • m_ID

        protected String m_ID
        the ID of the spectrum.
      • m_Format

        protected String m_Format
        the form of this data.
    • Constructor Detail

      • HasSpectrum

        public HasSpectrum()
    • Method Detail

      • globalInfo

        public String globalInfo()
        Returns a string describing the object.
        Specified by:
        globalInfo in interface adams.core.GlobalInfoSupporter
        Specified by:
        globalInfo in class adams.core.option.AbstractOptionHandler
        Returns:
        a description suitable for displaying in the gui
      • 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.core.option.AbstractOptionHandler
      • setID

        public void setID​(String value)
        Sets the ID to look, if not obtained from the passing through ID handler.
        Parameters:
        value - the ID
      • getID

        public String getID()
        Returns the ID to look, if not obtained from the passing through ID handler.
        Returns:
        the ID
      • IDTipText

        public String IDTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getDefaultFormat

        protected String getDefaultFormat()
        Returns the default format of the spectra.
        Returns:
        the default
      • setFormat

        public void setFormat​(String value)
        Sets the format string of the data (always converted to upper case). Use null to set default format.
        Parameters:
        value - the format
      • getFormat

        public String getFormat()
        Returns the format string of the data.
        Returns:
        the format
      • formatTipText

        public String formatTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • getQuickInfo

        public String getQuickInfo()
        Returns the quick info string to be displayed in the flow editor.
        Specified by:
        getQuickInfo in interface adams.flow.condition.bool.BooleanCondition
        Specified by:
        getQuickInfo in interface adams.core.QuickInfoSupporter
        Specified by:
        getQuickInfo in class adams.flow.condition.bool.AbstractBooleanCondition
        Returns:
        the info or null if no info to be displayed
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface adams.flow.condition.bool.BooleanCondition
        Specified by:
        accepts in class adams.flow.condition.bool.AbstractBooleanCondition
        Returns:
        adams.flow.core.Unknown.class
      • doEvaluate

        protected boolean doEvaluate​(adams.flow.core.Actor owner,
                                     adams.flow.core.Token token)
        Performs the actual evaluation.
        Specified by:
        doEvaluate in class adams.flow.condition.bool.AbstractBooleanCondition
        Parameters:
        owner - the owning actor
        token - the current token passing through
        Returns:
        the result of the evaluation