org.smartcomps.twister.engine.priv.core.definition
Interface Switch

All Superinterfaces:
Activity, StructuredActivity
All Known Implementing Classes:
SwitchImpl

public interface Switch
extends StructuredActivity

The Switch activity allows you to select exactly one branch of activity from a set of choices.
The conditions must be ordered following the same order as the activities stored in this container; first to keep a coherence between conditions and their activities; second because the first condition that is evaluated to true following the ordering will have its activity executed (and not the other ones).


Method Summary
 void addCondition(java.lang.String condition, org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Adds conditions to this Switch with their activities.
 java.util.SortedMap getActivityConditions()
          Returns a SortedMap containing the activities as keys ordered as they have been inserted in this container and their conditions as values.
 java.lang.String getCondition(int index)
          Returns the condition at index.
 java.util.List getConditions()
           
 void setOtherwise(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
          Sets an Activity as the otherwise for this Switch.
 
Methods inherited from interface org.smartcomps.twister.engine.priv.core.definition.StructuredActivity
addActivity, addExecutionContext, getActivities, getExecutionContexts
 
Methods inherited from interface org.smartcomps.twister.engine.priv.core.definition.Activity
fetchProcess, getContainer, getJoinCondition, getName, getProcess, getSourceLinks, getTargetLinks, setJoinCondition, setName, setSourceLinks, setTargetLinks
 

Method Detail

addCondition

public void addCondition(java.lang.String condition,
                         org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Adds conditions to this Switch with their activities. Conditions must be added in the same order as their activities have been created and assigned to this container.

Parameters:
condition -
activity -

getActivityConditions

public java.util.SortedMap getActivityConditions()
Returns a SortedMap containing the activities as keys ordered as they have been inserted in this container and their conditions as values.

Returns:
SortedMap ordered map of Activity/Condition pairs.

getCondition

public java.lang.String getCondition(int index)
Returns the condition at index.

Parameters:
index -
Returns:
int

getConditions

public java.util.List getConditions()

setOtherwise

public void setOtherwise(org.smartcomps.twister.engine.priv.core.definition.Activity activity)
Sets an Activity as the otherwise for this Switch. The otherwise activity must have been added last in this container (when created).

Parameters:
activity -


Copyright © 2003 SmartComps. All Rights Reserved.