Package adams.flow.condition.bool
Class HasVariable
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.condition.bool.AbstractBooleanCondition
-
- adams.flow.condition.bool.HasVariable
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<BooleanCondition>
,SizeOfHandler
,Stoppable
,BooleanCondition
,Serializable
public class HasVariable extends AbstractBooleanCondition
Evaluates to true if the specified variable is set.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-variable-name <adams.core.VariableName> (property: variableName) The name of the variable to check. default: variable
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected VariableName
m_VariableName
the name of the lookup table in the internal storage.-
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 HasVariable()
Default constructor.HasVariable(VariableName variableName)
Initializes with the specified variable name.HasVariable(String variableName)
Initializes with the specified variable name.
-
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(Actor owner, Token token)
Performs the actual evaluation.String
getQuickInfo()
Returns the quick info string to be displayed in the flow editor.VariableName
getVariableName()
Returns the name of the variable to check.String
globalInfo()
Returns a string describing the object.void
setVariableName(VariableName value)
Sets the name of the variable to check.void
setVariableName(String value)
Sets the name of the variable to check.String
variableNameTipText()
Returns the tip text for this property.-
Methods inherited from class adams.flow.condition.bool.AbstractBooleanCondition
evaluate, preEvaluate, setUp, shallowCopy, shallowCopy, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_VariableName
protected VariableName m_VariableName
the name of the lookup table in the internal storage.
-
-
Constructor Detail
-
HasVariable
public HasVariable()
Default constructor.
-
HasVariable
public HasVariable(VariableName variableName)
Initializes with the specified variable name.- Parameters:
variableName
- the variable name to use
-
HasVariable
public HasVariable(String variableName)
Initializes with the specified variable name.- Parameters:
variableName
- the variable name to use
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- 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 interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
getQuickInfo
public String getQuickInfo()
Returns the quick info string to be displayed in the flow editor.- Specified by:
getQuickInfo
in interfaceBooleanCondition
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Specified by:
getQuickInfo
in classAbstractBooleanCondition
- Returns:
- the info or null if no info to be displayed
-
setVariableName
public void setVariableName(String value)
Sets the name of the variable to check.- Parameters:
value
- the name
-
setVariableName
public void setVariableName(VariableName value)
Sets the name of the variable to check.- Parameters:
value
- the name
-
getVariableName
public VariableName getVariableName()
Returns the name of the variable to check.- Returns:
- the name
-
variableNameTipText
public String variableNameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
accepts
public Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceBooleanCondition
- Specified by:
accepts
in classAbstractBooleanCondition
- Returns:
- adams.flow.core.Unknown.class
-
doEvaluate
protected boolean doEvaluate(Actor owner, Token token)
Performs the actual evaluation.- Specified by:
doEvaluate
in classAbstractBooleanCondition
- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- the result of the evaluation
-
-