View Javadoc
1 package org.smartcomps.twister.engine.priv.core.definition; 2 3 import org.smartcomps.twister.engine.priv.core.definition.Activity; 4 import org.smartcomps.twister.engine.priv.core.definition.StructuredActivity; 5 6 import java.util.SortedMap; 7 import java.util.List; 8 9 /*** 10 * The Switch activity allows you to select exactly one branch of activity from 11 * a set of choices.<br> 12 * The conditions must be ordered following the same order as the activities 13 * stored in this container; first to keep a coherence between conditions and 14 * their activities; second because the first condition that is evaluated to true 15 * following the ordering will have its activity executed (and not the other 16 * ones). 17 */ 18 public interface Switch extends StructuredActivity { 19 20 /*** 21 * Adds conditions to this Switch with their activities. Conditions must 22 * be added in the same order as their activities have been created and 23 * assigned to this container. 24 * @param condition 25 * @param activity 26 */ 27 public void addCondition(String condition, Activity activity); 28 29 /*** 30 * Returns a SortedMap containing the activities as keys ordered as they 31 * have been inserted in this container and their conditions as values. 32 * @return SortedMap ordered map of Activity/Condition pairs. 33 */ 34 public SortedMap getActivityConditions(); 35 36 /*** 37 * Returns the condition at index. 38 * @param index 39 * @return int 40 */ 41 public String getCondition(int index); 42 43 public List getConditions(); 44 45 /*** 46 * Sets an Activity as the otherwise for this Switch. The otherwise activity 47 * must have been added last in this container (when created). 48 * @param activity 49 */ 50 public void setOtherwise(Activity activity); 51 52 }

This page was automatically generated by Maven