Package adams.flow.condition.bool
Class AbstractBooleanCondition
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.condition.bool.AbstractBooleanCondition
-
- All Implemented Interfaces:
Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<BooleanCondition>
,SizeOfHandler
,Stoppable
,BooleanCondition
,Serializable
- Direct Known Subclasses:
AbstractAttributeCapabilities
,AbstractBooleanDatabaseCondition
,AbstractExpression
,AbstractMultiCondition
,AbstractScript
,AbstractScriptedCondition
,BinaryFile
,BooleanReportValue
,BytesComplete
,Counting
,DirectoriesMatch
,DirectoryExists
,False
,FileComplete
,FileExists
,FileInUse
,FilesMatch
,HasClass
,HasColumn
,HasElements
,HasExifTag
,HashSet
,HasInterface
,HasLength
,HasMapValue
,HasProperty
,HasQueue
,HasRows
,HasSize
,HasStorageValue
,HasVariable
,HasVariableValue
,InList
,IsAndroid
,IsArm64
,IsArray
,IsBoolean
,IsByte
,IsBzip2Compressed
,IsDouble
,IsFloat
,IsGzipCompressed
,IsInteger
,IsLinux
,IsLong
,IsMac
,IsMat5Array
,IsMat5Matrix
,IsMat5Struct
,IsNull
,IsNumeric
,IsRarCompressed
,IsShort
,IsSubClass
,IsWindows
,IsXzCompressed
,IsZipCompressed
,IsZstdCompressed
,Not
,NotesErrors
,PromptUser
,RegExp
,ReportValueExists
,StorageFlagSet
,True
,VariableFlagSet
,WekaClassification
public abstract class AbstractBooleanCondition extends AbstractOptionHandler implements BooleanCondition, Stoppable
Ancestor for conditions that get evaluated in, e.g., the IfThenElse control actor, deciding which branch to take.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
-
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 AbstractBooleanCondition()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract Class[]
accepts()
Returns the class that the consumer accepts.protected abstract boolean
doEvaluate(Actor owner, Token token)
Performs the actual evaluation.boolean
evaluate(Actor owner, Token token)
Uses the token to determine the evaluation.abstract String
getQuickInfo()
Returns the quick info string to be displayed in the flow editor.protected String
preEvaluate(Actor owner, Token token)
Uses the token to determine the evaluation.String
setUp(Actor owner)
Configures the condition.AbstractBooleanCondition
shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.AbstractBooleanCondition
shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.void
stopExecution()
Stops the execution.-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, defineOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, 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
-
-
-
-
Method Detail
-
getQuickInfo
public abstract String getQuickInfo()
Returns the quick info string to be displayed in the flow editor.- Specified by:
getQuickInfo
in interfaceBooleanCondition
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Returns:
- the info or null if no info to be displayed
-
accepts
public abstract Class[] accepts()
Returns the class that the consumer accepts.- Specified by:
accepts
in interfaceBooleanCondition
- Returns:
- adams.flow.core.Unknown.class
-
setUp
public String setUp(Actor owner)
Configures the condition.- Specified by:
setUp
in interfaceBooleanCondition
- Parameters:
owner
- the actor this condition belongs to- Returns:
- null if everything is fine, otherwise error message
-
preEvaluate
protected String preEvaluate(Actor owner, Token token)
Uses the token to determine the evaluation.- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- null if OK, otherwise error message
-
doEvaluate
protected abstract boolean doEvaluate(Actor owner, Token token)
Performs the actual evaluation.- Parameters:
owner
- the owning actortoken
- the current token passing through- Returns:
- the result of the evaluation
-
evaluate
public boolean evaluate(Actor owner, Token token)
Uses the token to determine the evaluation.- Specified by:
evaluate
in interfaceBooleanCondition
- Parameters:
owner
- the owning actortoken
- the current token passing through the actor- Returns:
- the result of the evaluation
-
stopExecution
public void stopExecution()
Stops the execution.
Default implementation does nothing.- Specified by:
stopExecution
in interfaceBooleanCondition
- Specified by:
stopExecution
in interfaceStoppable
-
shallowCopy
public AbstractBooleanCondition shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceBooleanCondition
- Specified by:
shallowCopy
in interfaceShallowCopySupporter<BooleanCondition>
- Returns:
- the shallow copy
-
shallowCopy
public AbstractBooleanCondition shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopy
in interfaceBooleanCondition
- Specified by:
shallowCopy
in interfaceShallowCopySupporter<BooleanCondition>
- Parameters:
expand
- whether to expand variables to their current values- Returns:
- the shallow copy
-
-