View Javadoc

1   /*
2    *
3    *   Copyright 2005 The Apache Software Foundation.
4    *
5    *  Licensed under the Apache License, Version 2.0 (the "License");
6    *  you may not use this file except in compliance with the License.
7    *  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   */
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