Package adams.flow.core
Class AbstractActor
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.core.AbstractActor
-
- All Implemented Interfaces:
AdditionalInformationHandler,CleanUpHandler,Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,QuickInfoSupporter,ShallowCopySupporter<Actor>,SizeOfHandler,Stoppable,StoppableWithFeedback,VariablesInspectionHandler,VariableChangeListener,Actor,ErrorHandler,Serializable,Comparable
- Direct Known Subclasses:
AbstractBaseExternalActor,AbstractCallableActor,AbstractControlActor,AbstractCopyCallableActor,AbstractDisplay,AbstractPropertyUpdater,AbstractScriptedActor,AbstractSink,AbstractSource,AbstractStandalone,AbstractTemplate,AbstractTransformer,CallableActorScreenshot,ClipboardActorContainer,DesktopScreenshot,ExternalFlow,Stop,UpdateCallableDisplay
public abstract class AbstractActor extends AbstractOptionHandler implements Actor
Abstract base class for actors.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected BaseAnnotationm_Annotationsannotations for the actor.protected Hashtable<String,Object>m_BackupStatefor backing up the state of an actor.protected HashSet<String>m_DetectedObjectVariablesthe variable names (referencing callable actors or storage) that are used within this actor.protected HashSet<String>m_DetectedVariablesthe variable names that are used within this actor.protected ErrorHandlerm_ErrorHandlerthe error handler to use.protected booleanm_Executedwhether the actor was executed at least once after setup.protected booleanm_Executingwhether the actor is currently being executed.protected FlowExecutionListeningSupporterm_ExecutionListeningSupporterthe flow execution handler.protected Stringm_FullNamethe full name of the actor.protected Stringm_LoggingPrefixthe logging prefix.protected Stringm_Namethe name of the actor.protected Actorm_Parentthe parent actor this actor is part of, e.g., a sequence.protected ScopeHandlerm_ScopeHandlerthe scope handler.protected Actorm_Selfthe actor itself.protected booleanm_Silentwhether to suppress output in the console.protected booleanm_Skipwhether to skip the transformation and just forward the token.protected booleanm_StopFlowOnErrorwhether to stop the flow in case of an error.protected Stringm_StopMessagethe message that was used when stopping the execution.protected booleanm_Stoppedwhether the execution was stopped.protected StorageHandlerm_StorageHandlerthe storage handler.protected HashSet<String>m_VariablesUpdatedwhether the actor needs re-setting up because of modified variables.-
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 AbstractActor()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringannotationsTipText()Returns the tip text for this property.protected Hashtable<String,Object>backupState()Backs up the current state of the actor before update the variables.booleancanInspectOptions(Class cls)Checks whether the class' options can be inspected.protected booleancanPerformSetUpCheck(boolean fromSetUp, String property)Returns whether a check can be performed currently.voidcleanUp()Cleans up after the execution has finished.intcompareTo(Object o)Compares this object with the specified object for order.protected voidconfigureLogger()Initializes the logger.voiddefineOptions()Adds options to the internal list of options.voiddestroy()Frees up memory in a "destructive" non-reversible way.protected abstract StringdoExecute()Executes the flow item.booleanequals(Object o)Returns whether the two objects are the same.Stringexecute()Executes the flow item.protected voidfinalUpdateVariables()Gets called when the actor needs to re-evaluate variables before wrapping up.HashSet<String>findVariables()Recursively finds all the variables used in the actor's setup.protected HashSet<String>findVariables(Actor actor)Recursively finds all the variables used in the specified actor's setup.protected voidforceVariables(Variables value)Updates the Variables instance in use.static ActorforCommandLine(String cmdline)Instantiates the item from the given commandline (i.e., classname and optional options).static ActorforName(String classname, String[] options)Instantiates the item with the given options.static ActorforName(String classname, String[] options, boolean quiet)Instantiates the item with the given options.StringgetAdditionalInformation()Returns the additional information.BaseAnnotationgetAnnotations()Returns the current annotations.StringgetDefaultName()Returns the default name of the actor.HashSet<String>getDetectedVariables()Returns the variables this actor is responsible for.ErrorHandlergetErrorHandler()Returns the current error handler for handling errors in the flow.static String[]getFlowActors()Returns a list with classnames of items.FlowExecutionListeningSupportergetFlowExecutionListeningSupporter()Returns the flow execution handler in use.StringgetFullName()Returns the full name of the actor, i.e., the concatenated names of all parents.StringgetName()Returns the name of the actor.ActorgetNextSibling()If the actor is part of a group, this method returns the actor following it in that group.ActorgetParent()Returns the parent of this actor, e.g., the group.ComponentgetParentComponent()Returns the current parent component for interactive actors.ActorgetPreviousSibling()If the actor is part of a group, this method returns the actor preceding it in that group.StringgetQuickInfo()Returns a quick info about the actor, which will be displayed in the GUI.ActorgetRoot()Returns the root of this actor, e.g., the group at the highest level.ScopeHandlergetScopeHandler()Returns the scope handler for this actor.booleangetSilent()Returns whether to suppress output in the console.booleangetSkip()Returns whether transformation is skipped.booleangetStopFlowOnError()Returns whether to stop the flow execution at this level in case this actor encounters an error.StringgetStopMessage()Returns the stop message.StorageHandlergetStorageHandler()Returns the storage handler to use.VariablesgetVariables()Returns the Variables instance to use.StringhandleError(Actor source, String type, String msg)Handles the given error message with the flow that this actor belongs to, if the flow has error logging turned on.protected StringhandleException(String msg, Throwable t)Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.booleanhasErrorHandler()Checks if an error handler is set.booleanhasStopMessage()Returns whether a stop message is available (in case the flow was stopped with a message).intindex()Returns the index of this actor in its parent's collection.protected voidinitialize()Initializes the members.protected booleanisBackedUp(String key)Checks whether a specified key is present in the current backup state.booleanisExecuted()Returns whether the actor has been executed, after setting it up.booleanisExecuting()Returns whether the actor is currently being executed, i.e., processing some data or similar.booleanisFinished()Returns whether the item has finished.booleanisHeadless()Returns whether the actor is run in headless mode.booleanisStopped()Returns whether the execution was stopped.StringnameTipText()Returns the tip text for this property.protected StringperformSetUpChecks(boolean fromSetUp)Hook for performing setup checks -- used in setUp() and preExecute().protected StringperformVariableChecks()For performing variable checks.protected StringpostExecute()Post-execute hook.protected StringpreExecute()Pre-execute hook.protected voidpruneBackup()Removes entries from the backup.protected voidpruneBackup(String key)Removes the object with the specified key from the current backup state.protected voidreset()Resets the scheme.protected voidrestoreState(Hashtable<String,Object> state)Restores the state of the actor before the variables got updated.voidsetAnnotations(BaseAnnotation value)Sets the annoations.voidsetErrorHandler(ErrorHandler value)Sets the error handler to use for handling errors in the flow.voidsetName(String value)Sets the name of the actor.voidsetParent(Actor value)Sets the parent of this actor, e.g., the group it belongs to.voidsetSilent(boolean value)Sets whether to suppress output in the console.voidsetSkip(boolean value)Sets whether the transformation is skipped or not.voidsetStopFlowOnError(boolean value)Sets whether to stop the flow execution at this level in case this actor encounters an error.StringsetUp()Initializes the item for flow execution.voidsetVariables(Variables value)Updates the Variables instance in use, if different from current one.ActorshallowCopy()Returns a shallow copy of itself, i.e., based on the commandline options.ActorshallowCopy(boolean expand)Returns a shallow copy of itself, i.e., based on the commandline options.StringsilentTipText()Returns the tip text for this property.intsizeOf()Returns the size of the object.StringskipTipText()Returns the tip text for this property.voidstopExecution()Stops the execution.voidstopExecution(String msg)Stops the execution.StringstopFlowOnErrorTipText()Returns the tip text for this property.protected voidupdateDetectedVariables()Updates the detected variables.protected voidupdatePrefix()Updates the prefix of the logger.protected StringupdateVariables()Gets called when the actor needs to be re-setUp when a variable changes.voidvariableChanged(VariableChangeEvent e)Gets triggered when a variable changed (added, modified, removed).voidwrapUp()Cleans up after the execution has finished.-
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
toCommandLine
-
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_Self
protected Actor m_Self
the actor itself.
-
m_Name
protected String m_Name
the name of the actor.
-
m_FullName
protected String m_FullName
the full name of the actor.
-
m_LoggingPrefix
protected String m_LoggingPrefix
the logging prefix.
-
m_Parent
protected transient Actor m_Parent
the parent actor this actor is part of, e.g., a sequence.
-
m_Executed
protected boolean m_Executed
whether the actor was executed at least once after setup.
-
m_Executing
protected boolean m_Executing
whether the actor is currently being executed.
-
m_Stopped
protected boolean m_Stopped
whether the execution was stopped.
-
m_StopMessage
protected String m_StopMessage
the message that was used when stopping the execution.
-
m_Annotations
protected BaseAnnotation m_Annotations
annotations for the actor.
-
m_Skip
protected boolean m_Skip
whether to skip the transformation and just forward the token.
-
m_StopFlowOnError
protected boolean m_StopFlowOnError
whether to stop the flow in case of an error.
-
m_Silent
protected boolean m_Silent
whether to suppress output in the console.
-
m_DetectedVariables
protected HashSet<String> m_DetectedVariables
the variable names that are used within this actor.
-
m_DetectedObjectVariables
protected HashSet<String> m_DetectedObjectVariables
the variable names (referencing callable actors or storage) that are used within this actor.
-
m_VariablesUpdated
protected HashSet<String> m_VariablesUpdated
whether the actor needs re-setting up because of modified variables.
-
m_BackupState
protected Hashtable<String,Object> m_BackupState
for backing up the state of an actor.
-
m_StorageHandler
protected StorageHandler m_StorageHandler
the storage handler.
-
m_ScopeHandler
protected ScopeHandler m_ScopeHandler
the scope handler.
-
m_ErrorHandler
protected ErrorHandler m_ErrorHandler
the error handler to use.
-
m_ExecutionListeningSupporter
protected FlowExecutionListeningSupporter m_ExecutionListeningSupporter
the flow execution handler.
-
-
Method Detail
-
getAdditionalInformation
public String getAdditionalInformation()
Returns the additional information.- Specified by:
getAdditionalInformationin interfaceAdditionalInformationHandler- Returns:
- the additional information
-
initialize
protected void initialize()
Initializes the members.- Overrides:
initializein classAbstractOptionHandler
-
configureLogger
protected void configureLogger()
Initializes the logger.- Overrides:
configureLoggerin classLoggingObject
-
updatePrefix
protected void updatePrefix()
Updates the prefix of the logger.
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
reset
protected void reset()
Resets the scheme.- Overrides:
resetin classAbstractOptionHandler
-
getDefaultName
public String getDefaultName()
Returns the default name of the actor.- Specified by:
getDefaultNamein interfaceActor- Returns:
- the default name
-
isHeadless
public boolean isHeadless()
Returns whether the actor is run in headless mode.- Specified by:
isHeadlessin interfaceActor- Returns:
- true if GUI components are suppressed
-
setName
public void setName(String value)
Sets the name of the actor.
-
getName
public String getName()
Returns the name of the actor.
-
nameTipText
public String nameTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setAnnotations
public void setAnnotations(BaseAnnotation value)
Sets the annoations.- Specified by:
setAnnotationsin interfaceActor- Parameters:
value- the annotations
-
getAnnotations
public BaseAnnotation getAnnotations()
Returns the current annotations.- Specified by:
getAnnotationsin interfaceActor- Returns:
- the annotations
-
annotationsTipText
public String annotationsTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the gui
-
setSkip
public void setSkip(boolean value)
Sets whether the transformation is skipped or not.
-
getSkip
public boolean getSkip()
Returns whether transformation is skipped.
-
skipTipText
public String skipTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setStopFlowOnError
public void setStopFlowOnError(boolean value)
Sets whether to stop the flow execution at this level in case this actor encounters an error.- Specified by:
setStopFlowOnErrorin interfaceActor- Parameters:
value- true if flow gets stopped in case of an error
-
getStopFlowOnError
public boolean getStopFlowOnError()
Returns whether to stop the flow execution at this level in case this actor encounters an error.- Specified by:
getStopFlowOnErrorin interfaceActor- Returns:
- true if flow gets stopped in case of an error
-
stopFlowOnErrorTipText
public String stopFlowOnErrorTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setSilent
public void setSilent(boolean value)
Sets whether to suppress output in the console. Note: the enclosing actor handler needs to have this enabled as well.
-
getSilent
public boolean getSilent()
Returns whether to suppress output in the console. Note: the enclosing actor handler needs to have this enabled as well.
-
silentTipText
public String silentTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
handleError
public String handleError(Actor source, String type, String msg)
Handles the given error message with the flow that this actor belongs to, if the flow has error logging turned on. Might stop the flow as well.- Specified by:
handleErrorin interfaceActor- Specified by:
handleErrorin interfaceErrorHandler- Parameters:
source- the source of the errortype- the type of errormsg- the error message to log- Returns:
- null if error has been handled, otherwise the error message
- See Also:
Flow.getLogErrors(),Flow.getErrorHandling(),getStopFlowOnError()
-
handleException
protected String handleException(String msg, Throwable t)
Outputs the stacktrace along with the message on stderr and returns a combination of both of them as string.- Parameters:
msg- the message for the exceptiont- the exception- Returns:
- the full error message (message + stacktrace)
-
setParent
public void setParent(Actor value)
Sets the parent of this actor, e.g., the group it belongs to.
-
getParent
public Actor getParent()
Returns the parent of this actor, e.g., the group.
-
getParentComponent
public Component getParentComponent()
Returns the current parent component for interactive actors.- Specified by:
getParentComponentin interfaceActor- Returns:
- the parent, null if not set
-
index
public int index()
Returns the index of this actor in its parent's collection.
-
getRoot
public Actor getRoot()
Returns the root of this actor, e.g., the group at the highest level.
-
updateDetectedVariables
protected void updateDetectedVariables()
Updates the detected variables.
-
forceVariables
protected void forceVariables(Variables value)
Updates the Variables instance in use.
Use with caution!- Parameters:
value- the instance to use
-
setVariables
public void setVariables(Variables value)
Updates the Variables instance in use, if different from current one.
Use with caution!- Specified by:
setVariablesin interfaceActor- Parameters:
value- the instance to use- See Also:
forceVariables(Variables)
-
getVariables
public Variables getVariables()
Returns the Variables instance to use.- Specified by:
getVariablesin interfaceActor- Returns:
- the variables instance
-
getStorageHandler
public StorageHandler getStorageHandler()
Returns the storage handler to use.- Specified by:
getStorageHandlerin interfaceActor- Returns:
- the storage handler
-
getScopeHandler
public ScopeHandler getScopeHandler()
Returns the scope handler for this actor.- Specified by:
getScopeHandlerin interfaceActor- Returns:
- the scope handler
-
getFlowExecutionListeningSupporter
public FlowExecutionListeningSupporter getFlowExecutionListeningSupporter()
Returns the flow execution handler in use.- Specified by:
getFlowExecutionListeningSupporterin interfaceActor- Returns:
- the execution handler
-
getFullName
public String getFullName()
Returns the full name of the actor, i.e., the concatenated names of all parents. Used in error messages.- Specified by:
getFullNamein interfaceActor- Returns:
- the full name
-
getQuickInfo
public String getQuickInfo()
Returns a quick info about the actor, which will be displayed in the GUI.
Default implementation returns null.- Specified by:
getQuickInfoin interfaceActor- Specified by:
getQuickInfoin interfaceQuickInfoSupporter- Returns:
- null if no info available, otherwise short string
-
hasErrorHandler
public boolean hasErrorHandler()
Checks if an error handler is set.- Specified by:
hasErrorHandlerin interfaceActor- Returns:
- true if an error handler is set
-
setErrorHandler
public void setErrorHandler(ErrorHandler value)
Sets the error handler to use for handling errors in the flow.- Specified by:
setErrorHandlerin interfaceActor- Parameters:
value- the error handler
-
getErrorHandler
public ErrorHandler getErrorHandler()
Returns the current error handler for handling errors in the flow.- Specified by:
getErrorHandlerin interfaceActor- Returns:
- the error handler
-
canInspectOptions
public boolean canInspectOptions(Class cls)
Checks whether the class' options can be inspected.
Default implementation returns true.- Specified by:
canInspectOptionsin interfaceVariablesInspectionHandler- Parameters:
cls- the class to check- Returns:
- true if it can be inspected, false otherwise
-
findVariables
public HashSet<String> findVariables()
Recursively finds all the variables used in the actor's setup.- Specified by:
findVariablesin interfaceActor- Returns:
- the variables that were found
-
findVariables
protected HashSet<String> findVariables(Actor actor)
Recursively finds all the variables used in the specified actor's setup.- Parameters:
actor- the actor to search- Returns:
- the variables that were found
-
variableChanged
public void variableChanged(VariableChangeEvent e)
Gets triggered when a variable changed (added, modified, removed).- Specified by:
variableChangedin interfaceActor- Specified by:
variableChangedin interfaceVariableChangeListener- Parameters:
e- the event
-
getDetectedVariables
public HashSet<String> getDetectedVariables()
Returns the variables this actor is responsible for.- Specified by:
getDetectedVariablesin interfaceActor- Returns:
- the variables
-
setUp
public String setUp()
Initializes the item for flow execution. Also calls the reset() method first before anything else.
-
isBackedUp
protected boolean isBackedUp(String key)
Checks whether a specified key is present in the current backup state.- Parameters:
key- the key of the object to look for in the backup state- Returns:
- true if key present
-
pruneBackup
protected void pruneBackup(String key)
Removes the object with the specified key from the current backup state.- Parameters:
key- the key of the object to remove from the backup state
-
pruneBackup
protected void pruneBackup()
Removes entries from the backup.
Default implementation does nothing.- See Also:
reset()
-
backupState
protected Hashtable<String,Object> backupState()
Backs up the current state of the actor before update the variables.
Default implementation only returns an empty hashtable.- Returns:
- the backup
- See Also:
updateVariables(),restoreState(Hashtable)
-
restoreState
protected void restoreState(Hashtable<String,Object> state)
Restores the state of the actor before the variables got updated.
Default implementation does nothing.- Parameters:
state- the backup of the state to restore from- See Also:
updateVariables(),backupState()
-
updateVariables
protected String updateVariables()
Gets called when the actor needs to be re-setUp when a variable changes.- Returns:
- null if everything is fine, otherwise error message
-
canPerformSetUpCheck
protected boolean canPerformSetUpCheck(boolean fromSetUp, String property)Returns whether a check can be performed currently. Depending on whether a variable is attached to a property the property cannot be checked at setUp() time, but needs to be done at preExecute() time.- Parameters:
fromSetUp- whether the method has been called from within setUp()property- the property to check- Returns:
- true if the check can be performed
-
performSetUpChecks
protected String performSetUpChecks(boolean fromSetUp)
Hook for performing setup checks -- used in setUp() and preExecute().
Default implementation performs no checks.- Parameters:
fromSetUp- whether the method has been called from within setUp()- Returns:
- null if everything OK, otherwise error message
- See Also:
setUp(),preExecute()
-
performVariableChecks
protected String performVariableChecks()
For performing variable checks.- Returns:
- null if checks passed, otherwise error messages
- See Also:
preExecute()
-
preExecute
protected String preExecute()
Pre-execute hook.
Default implementation checks only whether the actor needs to be setup again due to changes in variables.- Returns:
- null if everything is fine, otherwise error message
-
doExecute
protected abstract String doExecute()
Executes the flow item.- Returns:
- null if everything is fine, otherwise error message
-
postExecute
protected String postExecute()
Post-execute hook.
Default implementation does nothing apart from setting m_Executed to true and only returns null.- Returns:
- null if everything is fine, otherwise error message
- See Also:
m_Executed
-
execute
public String execute()
Executes the flow item.
-
isFinished
public boolean isFinished()
Returns whether the item has finished. Theexecute()will be called as long as theisFinished()method returns false.- Specified by:
isFinishedin interfaceActor- Returns:
- true if finished, false if further calls to execute() are necessary. Default implementation returns always true, i.e., fires only once.
-
finalUpdateVariables
protected void finalUpdateVariables()
Gets called when the actor needs to re-evaluate variables before wrapping up.
-
wrapUp
public void wrapUp()
Cleans up after the execution has finished. Graphical output is left untouched.
-
cleanUp
public void cleanUp()
Cleans up after the execution has finished. Also removes graphical components.- Specified by:
cleanUpin interfaceActor- Specified by:
cleanUpin interfaceCleanUpHandler
-
destroy
public void destroy()
Frees up memory in a "destructive" non-reversible way.
Calls cleanUp().- Specified by:
destroyin interfaceActor- Specified by:
destroyin interfaceDestroyable- Overrides:
destroyin classAbstractOptionHandler- See Also:
AbstractOptionHandler.cleanUpOptions()
-
stopExecution
public void stopExecution()
Stops the execution. No message set.- Specified by:
stopExecutionin interfaceActor- Specified by:
stopExecutionin interfaceStoppable
-
stopExecution
public void stopExecution(String msg)
Stops the execution.- Specified by:
stopExecutionin interfaceActor- Parameters:
msg- the message to set as reason for stopping, can be null
-
isStopped
public boolean isStopped()
Returns whether the execution was stopped.- Specified by:
isStoppedin interfaceActor- Specified by:
isStoppedin interfaceStoppableWithFeedback- Returns:
- true if the execution was stopped
-
hasStopMessage
public boolean hasStopMessage()
Returns whether a stop message is available (in case the flow was stopped with a message).- Specified by:
hasStopMessagein interfaceActor- Returns:
- true if a message is available
-
getStopMessage
public String getStopMessage()
Returns the stop message.- Specified by:
getStopMessagein interfaceActor- Returns:
- the message, can be null
-
isExecuted
public boolean isExecuted()
Returns whether the actor has been executed, after setting it up.- Specified by:
isExecutedin interfaceActor- Returns:
- true if the actor has been executed
-
isExecuting
public boolean isExecuting()
Returns whether the actor is currently being executed, i.e., processing some data or similar.- Returns:
- true if currently active
-
getPreviousSibling
public Actor getPreviousSibling()
If the actor is part of a group, this method returns the actor preceding it in that group.- Specified by:
getPreviousSiblingin interfaceActor- Returns:
- the preceding actor, null if not available
-
getNextSibling
public Actor getNextSibling()
If the actor is part of a group, this method returns the actor following it in that group.- Specified by:
getNextSiblingin interfaceActor- Returns:
- the following actor, null if not available
-
compareTo
public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Only compares the commandlines of the two objects.- Specified by:
compareToin interfaceActor- Specified by:
compareToin interfaceComparable- Parameters:
o- the object to be compared.- Returns:
- a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
- Throws:
ClassCastException- if the specified object's type prevents it from being compared to this object.
-
equals
public boolean equals(Object o)
Returns whether the two objects are the same.
Only compares the commandlines of the two objects.
-
shallowCopy
public Actor shallowCopy()
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopyin interfaceActor- Specified by:
shallowCopyin interfaceShallowCopySupporter<Actor>- Returns:
- the shallow copy
-
shallowCopy
public Actor shallowCopy(boolean expand)
Returns a shallow copy of itself, i.e., based on the commandline options.- Specified by:
shallowCopyin interfaceActor- Specified by:
shallowCopyin interfaceShallowCopySupporter<Actor>- Parameters:
expand- whether to expand variables to their current values- Returns:
- the shallow copy
-
sizeOf
public int sizeOf()
Returns the size of the object.- Specified by:
sizeOfin interfaceActor- Specified by:
sizeOfin interfaceSizeOfHandler- Overrides:
sizeOfin classLoggingObject- Returns:
- the size of the object
-
getFlowActors
public static String[] getFlowActors()
Returns a list with classnames of items.- Returns:
- the item classnames
-
forName
public static Actor forName(String classname, String[] options)
Instantiates the item with the given options.- Parameters:
classname- the classname of the item to instantiateoptions- the options for the item- Returns:
- the instantiated item or null if an error occurred
-
forName
public static Actor forName(String classname, String[] options, boolean quiet)
Instantiates the item with the given options.- Parameters:
classname- the classname of the item to instantiateoptions- the options for the itemquiet- whether to suppress error messages- Returns:
- the instantiated item or null if an error occurred
-
forCommandLine
public static Actor forCommandLine(String cmdline)
Instantiates the item from the given commandline (i.e., classname and optional options).- Parameters:
cmdline- the classname (and optional options) of the item to instantiate- Returns:
- the instantiated item or null if an error occurred
-
-