Package adams.flow.control
Class AbstractConditionalActor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- adams.flow.control.AbstractConditionalActor
-
- All Implemented Interfaces:
AdditionalInformationHandler
,CleanUpHandler
,Destroyable
,GlobalInfoSupporter
,LoggingLevelHandler
,LoggingSupporter
,OptionHandler
,QuickInfoSupporter
,ShallowCopySupporter<Actor>
,SizeOfHandler
,Stoppable
,StoppableWithFeedback
,VariablesInspectionHandler
,VariableChangeListener
,TestConditionSupporter
,Actor
,ActorHandler
,ErrorHandler
,Flushable
,Serializable
,Comparable
- Direct Known Subclasses:
ConditionalSink
,ConditionalSource
,ConditionalStandalone
,ConditionalTransformer
@Deprecated public abstract class AbstractConditionalActor extends AbstractActor implements ActorHandler, TestConditionSupporter
Deprecated.Abstract superclass for actors that need to fullfil a test condition before they can be executed.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Actor
m_BaseActor
Deprecated.the base actor to run if condition is met.protected boolean
m_BaseActorInitialized
Deprecated.whether the base actor has been setup.protected boolean
m_CheckAtExecutionTime
Deprecated.whether to test condition during setup or whenever executed.protected TestCondition
m_Condition
Deprecated.the condition to check in the setUp() method of the actor.protected boolean
m_ExecuteOnFail
Deprecated.whether to execute the actor if the condition fails.-
Fields inherited from class adams.flow.core.AbstractActor
m_Annotations, m_BackupState, m_DetectedObjectVariables, m_DetectedVariables, m_ErrorHandler, m_Executed, m_Executing, m_ExecutionListeningSupporter, m_FullName, m_LoggingPrefix, m_Name, m_Parent, m_ScopeHandler, m_Self, m_Silent, m_Skip, m_StopFlowOnError, m_StopMessage, m_Stopped, m_StorageHandler, m_VariablesUpdated
-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
Fields inherited from interface adams.flow.core.Actor
FILE_EXTENSION, FILE_EXTENSION_GZ
-
-
Constructor Summary
Constructors Constructor Description AbstractConditionalActor()
Deprecated.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract String
actorTipText()
Deprecated.Returns the tip text for this property.boolean
canInspectOptions(Class cls)
Deprecated.Checks whether the class' options can be inspected.String
check()
Deprecated.Performs checks on the "sub-actors".String
checkAtExecutionTimeTipText()
Deprecated.Returns the tip text for this property.void
cleanUp()
Deprecated.Cleans up data structures, frees up memory.String
conditionTipText()
Deprecated.Returns the tip text for this property.void
defineOptions()
Deprecated.Adds options to the internal list of options.protected String
doExecute()
Deprecated.Executes the flow item.String
executeOnFailTipText()
Deprecated.Returns the tip text for this property.Actor
firstActive()
Deprecated.Returns the first non-skipped actor.void
flushExecution()
Deprecated.Stops the processing of tokens without stopping the flow.protected void
forceVariables(Variables value)
Deprecated.Updates the Variables instance in use.Actor
get(int index)
Deprecated.Returns the actor at the given position.Actor
getActor()
Deprecated.Returns the base actor.boolean
getCheckAtExecutionTime()
Deprecated.Returns whether to check the condition at execution time or during setup.TestCondition
getCondition()
Deprecated.Returns the currently set condition.protected abstract Actor
getDefaultActor()
Deprecated.Returns the default actor to use.boolean
getExecuteOnFail()
Deprecated.Returns whether to execute the actor when the condition fails instead of succeeds.String
getQuickInfo()
Deprecated.Returns a quick info about the actor, which will be displayed in the GUI.int
indexOf(String actor)
Deprecated.Returns the index of the actor.Actor
lastActive()
Deprecated.Returns the last non-skipped actor.protected String
preExecute()
Deprecated.Pre-execute hook.protected void
reset()
Deprecated.Initializes the members.String
set(int index, Actor actor)
Deprecated.Sets the actor at the given position.void
setActor(Actor value)
Deprecated.Sets the base actor.void
setCheckAtExecutionTime(boolean value)
Deprecated.Sets whether to check the condition at execution time or during setup.void
setCondition(TestCondition value)
Deprecated.Sets the condition to use.void
setExecuteOnFail(boolean value)
Deprecated.Sets whether to execute the actor when the condition fails instead of succeeds.String
setUp()
Deprecated.Initializes the item for flow execution.int
size()
Deprecated.Returns the size of the group.protected void
updateParent()
Deprecated.Updates the parent of all actors in this group.-
Methods inherited from class adams.flow.core.AbstractActor
annotationsTipText, backupState, canPerformSetUpCheck, compareTo, configureLogger, destroy, equals, execute, finalUpdateVariables, findVariables, findVariables, forCommandLine, forName, forName, getAdditionalInformation, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowActors, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, handleException, hasErrorHandler, hasStopMessage, index, initialize, isBackedUp, isExecuted, isExecuting, isFinished, isHeadless, isStopped, nameTipText, performSetUpChecks, performVariableChecks, postExecute, pruneBackup, pruneBackup, restoreState, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, silentTipText, sizeOf, skipTipText, stopExecution, stopExecution, stopFlowOnErrorTipText, updateDetectedVariables, updatePrefix, updateVariables, variableChanged, wrapUp
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, finishInit, getDefaultLoggingLevel, getOptionManager, globalInfo, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.flow.core.Actor
compareTo, destroy, equals, execute, findVariables, getAnnotations, getDefaultName, getDetectedVariables, getErrorHandler, getFlowExecutionListeningSupporter, getFullName, getName, getNextSibling, getParent, getParentComponent, getPreviousSibling, getRoot, getScopeHandler, getSilent, getSkip, getStopFlowOnError, getStopMessage, getStorageHandler, getVariables, handleError, hasErrorHandler, hasStopMessage, index, isExecuted, isFinished, isHeadless, isStopped, setAnnotations, setErrorHandler, setName, setParent, setSilent, setSkip, setStopFlowOnError, setVariables, shallowCopy, shallowCopy, sizeOf, stopExecution, stopExecution, toCommandLine, variableChanged, wrapUp
-
Methods inherited from interface adams.flow.core.ActorHandler
getActorHandlerInfo
-
Methods inherited from interface adams.core.AdditionalInformationHandler
getAdditionalInformation
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel, setLoggingLevel
-
Methods inherited from interface adams.core.logging.LoggingSupporter
getLogger, isLoggingEnabled
-
Methods inherited from interface adams.core.option.OptionHandler
cleanUpOptions, getOptionManager
-
-
-
-
Field Detail
-
m_Condition
protected TestCondition m_Condition
Deprecated.the condition to check in the setUp() method of the actor.
-
m_BaseActor
protected Actor m_BaseActor
Deprecated.the base actor to run if condition is met.
-
m_CheckAtExecutionTime
protected boolean m_CheckAtExecutionTime
Deprecated.whether to test condition during setup or whenever executed.
-
m_ExecuteOnFail
protected boolean m_ExecuteOnFail
Deprecated.whether to execute the actor if the condition fails.
-
m_BaseActorInitialized
protected boolean m_BaseActorInitialized
Deprecated.whether the base actor has been setup.
-
-
Method Detail
-
defineOptions
public void defineOptions()
Deprecated.Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractActor
-
getQuickInfo
public String getQuickInfo()
Deprecated.Returns a quick info about the actor, which will be displayed in the GUI.- Specified by:
getQuickInfo
in interfaceActor
- Specified by:
getQuickInfo
in interfaceQuickInfoSupporter
- Overrides:
getQuickInfo
in classAbstractActor
- Returns:
- null if no info available, otherwise short string
-
reset
protected void reset()
Deprecated.Initializes the members.- Overrides:
reset
in classAbstractActor
-
setCondition
public void setCondition(TestCondition value)
Deprecated.Sets the condition to use.- Specified by:
setCondition
in interfaceTestConditionSupporter
- Parameters:
value
- the condition
-
getCondition
public TestCondition getCondition()
Deprecated.Returns the currently set condition.- Specified by:
getCondition
in interfaceTestConditionSupporter
- Returns:
- the condition
-
conditionTipText
public String conditionTipText()
Deprecated.Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setCheckAtExecutionTime
public void setCheckAtExecutionTime(boolean value)
Deprecated.Sets whether to check the condition at execution time or during setup.- Parameters:
value
- true if to check at execution time
-
getCheckAtExecutionTime
public boolean getCheckAtExecutionTime()
Deprecated.Returns whether to check the condition at execution time or during setup.- Returns:
- true if the check happens at execution time
-
checkAtExecutionTimeTipText
public String checkAtExecutionTimeTipText()
Deprecated.Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setExecuteOnFail
public void setExecuteOnFail(boolean value)
Deprecated.Sets whether to execute the actor when the condition fails instead of succeeds.- Parameters:
value
- if true then the actor gets executed when the condition fails
-
getExecuteOnFail
public boolean getExecuteOnFail()
Deprecated.Returns whether to execute the actor when the condition fails instead of succeeds.- Returns:
- true if the check happens at execution time
-
executeOnFailTipText
public String executeOnFailTipText()
Deprecated.Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
getDefaultActor
protected abstract Actor getDefaultActor()
Deprecated.Returns the default actor to use.- Returns:
- the default actor
-
setActor
public void setActor(Actor value)
Deprecated.Sets the base actor.- Parameters:
value
- the actor
-
getActor
public Actor getActor()
Deprecated.Returns the base actor.- Returns:
- the actor
-
actorTipText
public abstract String actorTipText()
Deprecated.Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
check
public String check()
Deprecated.Performs checks on the "sub-actors".- Specified by:
check
in interfaceActorHandler
- Returns:
- null if everything is fine, otherwise the error
-
updateParent
protected void updateParent()
Deprecated.Updates the parent of all actors in this group.
-
size
public int size()
Deprecated.Returns the size of the group.- Specified by:
size
in interfaceActorHandler
- Returns:
- always 1
-
get
public Actor get(int index)
Deprecated.Returns the actor at the given position.- Specified by:
get
in interfaceActorHandler
- Parameters:
index
- the position- Returns:
- the actor
-
set
public String set(int index, Actor actor)
Deprecated.Sets the actor at the given position.- Specified by:
set
in interfaceActorHandler
- Parameters:
index
- the positionactor
- the actor to set at this position- Returns:
- null if everything is fine, otherwise the error
-
indexOf
public int indexOf(String actor)
Deprecated.Returns the index of the actor.- Specified by:
indexOf
in interfaceActorHandler
- Parameters:
actor
- the name of the actor to look for- Returns:
- the index of -1 if not found
-
firstActive
public Actor firstActive()
Deprecated.Returns the first non-skipped actor.- Specified by:
firstActive
in interfaceActorHandler
- Returns:
- the first 'active' actor, null if none available
-
lastActive
public Actor lastActive()
Deprecated.Returns the last non-skipped actor.- Specified by:
lastActive
in interfaceActorHandler
- Returns:
- the last 'active' actor, null if none available
-
canInspectOptions
public boolean canInspectOptions(Class cls)
Deprecated.Checks whether the class' options can be inspected. By default, arrays of actors (i.e., the control actor's sub-actors) won't be inspected, as they do it themselves.- Specified by:
canInspectOptions
in interfaceVariablesInspectionHandler
- Overrides:
canInspectOptions
in classAbstractActor
- Parameters:
cls
- the class to check- Returns:
- true if it can be inspected, false otherwise
-
forceVariables
protected void forceVariables(Variables value)
Deprecated.Updates the Variables instance in use.
Use with caution!- Overrides:
forceVariables
in classAbstractActor
- Parameters:
value
- the instance to use
-
setUp
public String setUp()
Deprecated.Initializes the item for flow execution.- Specified by:
setUp
in interfaceActor
- Overrides:
setUp
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
- See Also:
AbstractActor.reset()
-
preExecute
protected String preExecute()
Deprecated.Pre-execute hook.- Overrides:
preExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
doExecute
protected String doExecute()
Deprecated.Executes the flow item.- Specified by:
doExecute
in classAbstractActor
- Returns:
- null if everything is fine, otherwise error message
-
flushExecution
public void flushExecution()
Deprecated.Stops the processing of tokens without stopping the flow.- Specified by:
flushExecution
in interfaceActorHandler
- Specified by:
flushExecution
in interfaceFlushable
-
cleanUp
public void cleanUp()
Deprecated.Cleans up data structures, frees up memory.- Specified by:
cleanUp
in interfaceActor
- Specified by:
cleanUp
in interfaceCleanUpHandler
- Overrides:
cleanUp
in classAbstractActor
-
-