Package adams.flow.condition.bool
Class HasSpectrum
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.condition.bool.AbstractBooleanCondition
-
- adams.flow.condition.bool.AbstractBooleanDatabaseCondition
-
- adams.flow.condition.bool.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
-
-
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
-
-
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceadams.core.GlobalInfoSupporter
- Specified by:
globalInfo
in classadams.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 interfaceadams.core.option.OptionHandler
- Overrides:
defineOptions
in classadams.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 interfaceadams.flow.condition.bool.BooleanCondition
- Specified by:
getQuickInfo
in interfaceadams.core.QuickInfoSupporter
- Specified by:
getQuickInfo
in classadams.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 interfaceadams.flow.condition.bool.BooleanCondition
- Specified by:
accepts
in classadams.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 classadams.flow.condition.bool.AbstractBooleanCondition
- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- the result of the evaluation
-
-