Package adams.flow.control
Class IfThenElse.IfThenElseDirector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.control.AbstractDirector
-
- adams.flow.control.IfThenElse.IfThenElseDirector
-
- All Implemented Interfaces:
CleanUpHandler,LoggingSupporter,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowPauseStateListener,Serializable
- Enclosing class:
- IfThenElse
public static class IfThenElse.IfThenElseDirector extends AbstractDirector
A specialized director for an AbstractIfThenElse control actor.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Tokenm_BranchTokenthe token to use in the then/else branches.-
Fields inherited from class adams.flow.control.AbstractDirector
m_ControlActor, m_Flushing, m_LoggingPrefix, m_Paused, m_Stopped, m_Stopping
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description IfThenElseDirector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.protected booleandoThen()Determines whether to execute the 'then' branch.Stringexecute()Executes the group of actors.TokengetBranchToken()Returns the token to be forwarded to then/else branches.voidsetBranchToken(Token value)Sets the token to use in the then/else branches.voidsetControlActor(AbstractDirectedControlActor value)Sets the group to execute.protected voidsetIfThenElseActor(AbstractDirectedControlActor value)Calls the super implementation of setControlActor.-
Methods inherited from class adams.flow.control.AbstractDirector
configureLogger, flowPauseStateChanged, flushExecution, getControlActor, getVariables, handleException, hasControlActor, initialize, isFinished, isFlushing, isPaused, isStopped, isStopping, pause, pauseExecution, setControlActor, setLoggingLevel, stopExecution, toString, updatePrefix
-
Methods inherited from class adams.core.logging.LoggingObject
getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_BranchToken
protected transient Token m_BranchToken
the token to use in the then/else branches.
-
-
Method Detail
-
setIfThenElseActor
protected void setIfThenElseActor(AbstractDirectedControlActor value)
Calls the super implementation of setControlActor.- Parameters:
value- the control actor to set
-
setControlActor
public void setControlActor(AbstractDirectedControlActor value)
Sets the group to execute.- Parameters:
value- the group
-
setBranchToken
public void setBranchToken(Token value)
Sets the token to use in the then/else branches.- Parameters:
value- the token to use
-
getBranchToken
public Token getBranchToken()
Returns the token to be forwarded to then/else branches.- Returns:
- the token, can be null if not yet set
-
doThen
protected boolean doThen()
Determines whether to execute the 'then' branch.- Returns:
- true if the 'then' branch should get executed
-
execute
public String execute()
Executes the group of actors.- Specified by:
executein classAbstractDirector- Returns:
- null if everything went smooth
-
cleanUp
public void cleanUp()
Cleans up data structures, frees up memory.- Specified by:
cleanUpin interfaceCleanUpHandler- Overrides:
cleanUpin classAbstractDirector
-
-