1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.scxml;
19
20 import java.util.ArrayList;
21 import java.util.Collection;
22 import java.util.List;
23
24 /***
25 * A logical unit of progression in the execution of a SCXML model.
26 *
27 */
28 public class Step {
29
30 /***
31 * Constructor.
32 */
33 public Step() {
34 this.externalEvents = new ArrayList();
35 this.beforeStatus = new Status();
36 this.afterStatus = new Status();
37 this.exitList = new ArrayList();
38 this.entryList = new ArrayList();
39 this.transitList = new ArrayList();
40 }
41
42 /***
43 * @param externalEvents The external events received in this
44 * unit of progression
45 * @param beforeStatus The before status
46 */
47 public Step(final Collection externalEvents, final Status beforeStatus) {
48 if (externalEvents != null) {
49 this.externalEvents = externalEvents;
50 } else {
51 this.externalEvents = new ArrayList();
52 }
53 if (beforeStatus != null) {
54 this.beforeStatus = beforeStatus;
55 } else {
56 this.beforeStatus = new Status();
57 }
58 this.afterStatus = new Status();
59 this.exitList = new ArrayList();
60 this.entryList = new ArrayList();
61 this.transitList = new ArrayList();
62 }
63
64 /***
65 * The external events in this step.
66 */
67 private Collection externalEvents;
68
69 /***
70 * The status before this step.
71 */
72 private Status beforeStatus;
73
74 /***
75 * The status after this step.
76 */
77 private Status afterStatus;
78
79 /***
80 * The list of TransitionTargets that were exited during this step.
81 */
82 private List exitList;
83
84 /***
85 * The list of TransitionTargets that were entered during this step.
86 */
87 private List entryList;
88
89 /***
90 * The list of Transitions taken during this step.
91 */
92 private List transitList;
93
94 /***
95 * @return Returns the afterStatus.
96 */
97 public Status getAfterStatus() {
98 return afterStatus;
99 }
100
101 /***
102 * @param afterStatus The afterStatus to set.
103 */
104 public void setAfterStatus(final Status afterStatus) {
105 this.afterStatus = afterStatus;
106 }
107
108 /***
109 * @return Returns the beforeStatus.
110 */
111 public Status getBeforeStatus() {
112 return beforeStatus;
113 }
114
115 /***
116 * @param beforeStatus The beforeStatus to set.
117 */
118 public void setBeforeStatus(final Status beforeStatus) {
119 this.beforeStatus = beforeStatus;
120 }
121
122 /***
123 * @return Returns the entryList.
124 */
125 public List getEntryList() {
126 return entryList;
127 }
128
129 /***
130 * @return Returns the exitList.
131 */
132 public List getExitList() {
133 return exitList;
134 }
135
136 /***
137 * @return Returns the externalEvents.
138 */
139 public Collection getExternalEvents() {
140 return externalEvents;
141 }
142
143 /***
144 * @return Returns the transitList.
145 */
146 public List getTransitList() {
147 return transitList;
148 }
149
150 }
151