Package adams.flow.control
Class Switch.SwitchDirector
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.flow.control.AbstractDirector
-
- adams.flow.control.Switch.SwitchDirector
-
- All Implemented Interfaces:
CleanUpHandler,LoggingSupporter,SizeOfHandler,Stoppable,StoppableWithFeedback,FlowPauseStateListener,Serializable
- Enclosing class:
- Switch
public static class Switch.SwitchDirector extends AbstractDirector
A specialized director for the Switch 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_CaseTokenthe token to use in the switch cases.-
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 SwitchDirector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcleanUp()Cleans up data structures, frees up memory.Stringexecute()Executes the group of actors.TokengetCaseToken()Returns the token to be forwarded to switch cases.voidsetCaseToken(Token value)Sets the token to use in the switch cases.voidsetControlActor(AbstractDirectedControlActor value)Sets the group to execute.protected intwhichCase()Determines which case to execute.-
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_CaseToken
protected transient Token m_CaseToken
the token to use in the switch cases.
-
-
Method Detail
-
setControlActor
public void setControlActor(AbstractDirectedControlActor value)
Sets the group to execute.- Parameters:
value- the group
-
setCaseToken
public void setCaseToken(Token value)
Sets the token to use in the switch cases.- Parameters:
value- the token to use
-
getCaseToken
public Token getCaseToken()
Returns the token to be forwarded to switch cases.- Returns:
- the token, can be null if not yet set
-
whichCase
protected int whichCase()
Determines which case to execute.- Returns:
- the index of the case to execute
-
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
-
-