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.AbstractBooleanDatabaseConditionChecks 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.voiddefineOptions()Adds options to the internal list of options.protected booleandoEvaluate(adams.flow.core.Actor owner, adams.flow.core.Token token)Performs the actual evaluation.StringformatTipText()Returns the tip text for this property.protected StringgetDefaultFormat()Returns the default format of the spectra.StringgetFormat()Returns the format string of the data.StringgetID()Returns the ID to look, if not obtained from the passing through ID handler.StringgetQuickInfo()Returns the quick info string to be displayed in the flow editor.StringglobalInfo()Returns a string describing the object.StringIDTipText()Returns the tip text for this property.voidsetFormat(String value)Sets the format string of the data (always converted to upper case).voidsetID(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:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin 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:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin 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:
getQuickInfoin interfaceadams.flow.condition.bool.BooleanCondition- Specified by:
getQuickInfoin interfaceadams.core.QuickInfoSupporter- Specified by:
getQuickInfoin 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:
acceptsin interfaceadams.flow.condition.bool.BooleanCondition- Specified by:
acceptsin 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:
doEvaluatein classadams.flow.condition.bool.AbstractBooleanCondition- Parameters:
owner- the owning actortoken- the current token passing through- Returns:
- the result of the evaluation
-
-