01: package org.enhydra.shark.xpdl.elements;
02:
03: import java.util.ArrayList;
04:
05: import org.enhydra.shark.xpdl.XMLComplexChoice;
06: import org.enhydra.shark.xpdl.XMLElement;
07:
08: /**
09: * Represents Activity types from XPDL schema.
10: *
11: * @author Sasa Bojanic
12: */
13: public class ActivityTypes extends XMLComplexChoice {
14:
15: public ActivityTypes(Activity parent) {
16: super (parent, "Type", true);
17: }
18:
19: protected void fillChoices() {
20: choices = new ArrayList();
21: choices.add(new Route(this ));
22: choices.add(new Implementation(this ));
23: choices.add(new BlockActivity(this ));
24: choosen = (XMLElement) choices.get(0);
25: }
26:
27: public Route getRoute() {
28: return (Route) choices.get(0);
29: }
30:
31: public void setRoute() {
32: setChoosen((Route) choices.get(0));
33: }
34:
35: public Implementation getImplementation() {
36: return (Implementation) choices.get(1);
37: }
38:
39: public void setImplementation() {
40: setChoosen((Implementation) choices.get(1));
41: }
42:
43: public BlockActivity getBlockActivity() {
44: return (BlockActivity) choices.get(2);
45: }
46:
47: public void setBlockActivity() {
48: setChoosen((BlockActivity) choices.get(2));
49: }
50:
51: }
|