Class SwitchedSource

    • Field Detail

      • m_Conditions

        protected BooleanCondition[] m_Conditions
        the "conditions" for the various switch cases.
      • m_Cases

        protected List<Actor> m_Cases
        the "cases" to execute if the corresponding expression matches.
      • m_ActiveCase

        protected Actor m_ActiveCase
        the active case.
    • Constructor Detail

      • SwitchedSource

        public SwitchedSource()
    • Method Detail

      • reset

        protected void reset()
        Resets the actor.
        Overrides:
        reset in class AbstractActor
      • setConditions

        public void setConditions​(BooleanCondition[] value)
        Sets the conditions to evaluate.
        Parameters:
        value - the conditions
      • getConditions

        public BooleanCondition[] getConditions()
        Returns the conditions to evaluate.
        Returns:
        the conditions
      • conditionsTipText

        public String conditionsTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setCases

        public void setCases​(Actor[] value)
        Sets the cases.
        Parameters:
        value - the cases
      • getCases

        public Actor[] getCases()
        Returns the cases.
        Returns:
        the cases
      • casesTipText

        public String casesTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • size

        public int size()
        Returns the size of the group.
        Specified by:
        size in interface ActorHandler
        Returns:
        the number of cases
      • get

        public Actor get​(int index)
        Returns the actor at the given position.
        Specified by:
        get in interface ActorHandler
        Parameters:
        index - the position
        Returns:
        the actor
      • updateParent

        protected void updateParent()
        Updates the parent of all actors in this group.
      • set

        public String set​(int index,
                          Actor actor)
        Sets the actor at the given position.
        Specified by:
        set in interface ActorHandler
        Parameters:
        index - the position
        actor - the actor to set at this position
        Returns:
        null if successful, otherwise error message
      • add

        public String add​(Actor actor)
        Inserts the actor at the end.
        Specified by:
        add in interface MutableActorHandler
        Parameters:
        actor - the actor to insert
        Returns:
        null if successful, otherwise error message
      • add

        public String add​(int index,
                          Actor actor)
        Inserts the actor at the given position.
        Specified by:
        add in interface MutableActorHandler
        Parameters:
        index - the position
        actor - the actor to insert
        Returns:
        null if successful, otherwise error message
      • remove

        public Actor remove​(int index)
        Removes the actor at the given position and returns the removed object.
        Specified by:
        remove in interface MutableActorHandler
        Parameters:
        index - the position
        Returns:
        the removed actor
      • indexOf

        public int indexOf​(String actor)
        Returns the index of the actor.
        Specified by:
        indexOf in interface ActorHandler
        Parameters:
        actor - the name of the actor to look for
        Returns:
        the index of -1 if not found
      • firstActive

        public Actor firstActive()
        Returns the first non-skipped actor.
        Specified by:
        firstActive in interface ActorHandler
        Returns:
        the first 'active' actor, null if none available
      • lastActive

        public Actor lastActive()
        Returns the last non-skipped actor.
        Specified by:
        lastActive in interface ActorHandler
        Returns:
        the last 'active' actor, null if none available
      • getActorHandlerInfo

        public ActorHandlerInfo getActorHandlerInfo()
        Returns some information about the actor handler, e.g., whether it can contain standalones and the actor execution.
        Specified by:
        getActorHandlerInfo in interface ActorHandler
        Returns:
        the info
      • forceVariables

        protected void forceVariables​(Variables value)
        Updates the Variables instance in use.

        Use with caution!
        Overrides:
        forceVariables in class AbstractActor
        Parameters:
        value - the instance to use
      • check

        public String check​(int index,
                            Actor actor)
        Performs checks on the "sub-actor".
        Parameters:
        index - the index of the actor
        actor - the actor to check
        Returns:
        null if successful passed, otherwise error message
      • check

        public String check()
        Performs checks on the "sub-actors".
        Specified by:
        check in interface ActorHandler
        Returns:
        null
      • whichCase

        protected int whichCase()
        Determines which case to execute.
        Returns:
        the index of the case to execute
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        the Class of the generated tokens
      • hasPendingOutput

        public boolean hasPendingOutput()
        Checks whether there is pending output to be collected after executing the flow item.
        Specified by:
        hasPendingOutput in interface OutputProducer
        Returns:
        true if there is pending output
      • output

        public Token output()
        Returns the generated token.
        Specified by:
        output in interface OutputProducer
        Returns:
        the generated token