View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.commons.scxml;
18  
19  import java.util.ArrayList;
20  import java.util.Collection;
21  import java.util.List;
22  
23  /***
24   * A logical unit of progression in the execution of a SCXML model.
25   *
26   */
27  public class Step {
28  
29      /***
30       * Constructor.
31        */
32      public Step() {
33          this.externalEvents = new ArrayList();
34          this.beforeStatus = new Status();
35          this.afterStatus = new Status();
36          this.exitList = new ArrayList();
37          this.entryList = new ArrayList();
38          this.transitList = new ArrayList();
39      }
40  
41      /***
42       * @param externalEvents The external events received in this
43       *     unit of progression
44       * @param beforeStatus The before status
45       */
46      public Step(final Collection externalEvents, final Status beforeStatus) {
47          if (externalEvents != null) {
48              this.externalEvents = externalEvents;
49          } else {
50              this.externalEvents = new ArrayList();
51          }
52          if (beforeStatus != null) {
53              this.beforeStatus = beforeStatus;
54          } else {
55              this.beforeStatus = new Status();
56          }
57          this.afterStatus = new Status();
58          this.exitList = new ArrayList();
59          this.entryList = new ArrayList();
60          this.transitList = new ArrayList();
61      }
62  
63      /***
64       * The external events in this step.
65       */
66      private Collection externalEvents;
67  
68      /***
69       * The status before this step.
70       */
71      private Status beforeStatus;
72  
73      /***
74       * The status after this step.
75       */
76      private Status afterStatus;
77  
78      /***
79       * The list of TransitionTargets that were exited during this step.
80       */
81      private List exitList;
82  
83      /***
84       * The list of TransitionTargets that were entered during this step.
85       */
86      private List entryList;
87  
88      /***
89       * The list of Transitions taken during this step.
90       */
91      private List transitList;
92  
93      /***
94       * @return Returns the afterStatus.
95       */
96      public Status getAfterStatus() {
97          return afterStatus;
98      }
99  
100     /***
101      * @param afterStatus The afterStatus to set.
102      */
103     public void setAfterStatus(final Status afterStatus) {
104         this.afterStatus = afterStatus;
105     }
106 
107     /***
108      * @return Returns the beforeStatus.
109      */
110     public Status getBeforeStatus() {
111         return beforeStatus;
112     }
113 
114     /***
115      * @param beforeStatus The beforeStatus to set.
116      */
117     public void setBeforeStatus(final Status beforeStatus) {
118         this.beforeStatus = beforeStatus;
119     }
120 
121     /***
122      * @return Returns the entryList.
123      */
124     public List getEntryList() {
125         return entryList;
126     }
127 
128     /***
129      * @return Returns the exitList.
130      */
131     public List getExitList() {
132         return exitList;
133     }
134 
135     /***
136      * @return Returns the externalEvents.
137      */
138     public Collection getExternalEvents() {
139         return externalEvents;
140     }
141 
142     /***
143      * @return Returns the transitList.
144      */
145     public List getTransitList() {
146         return transitList;
147     }
148 
149 }
150