Package adams.flow.condition.bool
Class InList
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<BooleanCondition>
,SizeOfHandler
,Stoppable
,BooleanCondition
,Serializable
public class InList extends AbstractBooleanCondition
Checks whether the incoming string is among the specified items.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-item <adams.core.base.BaseString> [-item ...] (property: items) The items to match the string against. default:
-value <java.lang.String> (property: value) The value (if non-empty) to look for in the items, takes precedence of the token passing through. default:
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseString[]
m_Items
the strings to match against.protected Set<String>
m_ItemSet
the set to use for checks.protected String
m_Value
the value to check.-
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 InList()
-
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.BaseString[]
getItems()
Returns the string items to check against.String
getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.String
getValue()
Returns the (optional) value to look for in the items, takes precedence over the token passing through.String
globalInfo()
Returns a string describing the object.String
itemsTipText()
Returns the tip text for this property.protected void
reset()
Resets the scheme.void
setItems(BaseString[] value)
Sets the string items to check against.void
setValue(String value)
Sets the (optional) value to look for in the items, takes precedence over the token passing through.String
valueTipText()
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, 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_Items
protected BaseString[] m_Items
the strings to match against.
-
m_Value
protected String m_Value
the value to check.
-
-
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
-
reset
protected void reset()
Resets the scheme.- Overrides:
reset
in classAbstractOptionHandler
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceBooleanCondition
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Specified by:
getQuickInfo
in classAbstractBooleanCondition
- Returns:
- null if no info available, otherwise short string
-
setItems
public void setItems(BaseString[] value)
Sets the string items to check against.- Parameters:
value
- the items
-
getItems
public BaseString[] getItems()
Returns the string items to check against.- Returns:
- the items
-
itemsTipText
public String itemsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setValue
public void setValue(String value)
Sets the (optional) value to look for in the items, takes precedence over the token passing through.- Parameters:
value
- the value
-
getValue
public String getValue()
Returns the (optional) value to look for in the items, takes precedence over the token passing through.- Returns:
- the value
-
valueTipText
public String valueTipText()
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
-
-