##### Coverage Report - org.apache.commons.scxml.Step

Classes in this File | Line Coverage | Branch Coverage | Complexity
Step |
57% |
100% |
| 1.2;1.2

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 | 0 |
         public Step() {
33 | 0 |
             this.externalEvents = new ArrayList();
34 | 0 |
             this.beforeStatus = new Status();
35 | 0 |
             this.afterStatus = new Status();
36 | 0 |
             this.exitList = new ArrayList();
37 | 0 |
             this.entryList = new ArrayList();
38 | 0 |
             this.transitList = new ArrayList();
39 | 0 |
         }
40 |  |
41 |  |
         /**
42 |  |
          * @param externalEvents The external events received in this
43 |  |
          *     unit of progression
44 |  |
          * @param beforeStatus The before status
45 |  |
          */
46 | 316 |
         public Step(final Collection externalEvents, final Status beforeStatus) {
47 | 316 |
             if (externalEvents != null) {
48 | 266 |
                 this.externalEvents = externalEvents;
49 |  |
             } else {
50 | 50 |
                 this.externalEvents = new ArrayList();
51 |  |
             }
52 | 316 |
             if (beforeStatus != null) {
53 | 316 |
                 this.beforeStatus = beforeStatus;
54 |  |
             } else {
55 | 0 |
                 this.beforeStatus = new Status();
56 |  |
             }
57 | 316 |
             this.afterStatus = new Status();
58 | 316 |
             this.exitList = new ArrayList();
59 | 316 |
             this.entryList = new ArrayList();
60 | 316 |
             this.transitList = new ArrayList();
61 | 316 |
         }
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 | 1250 |
             return afterStatus;
98 |  |
         }
99 |  |
100 |  |
         /**
101 |  |
          * @param afterStatus The afterStatus to set.
102 |  |
          */
103 |  |
         public void setAfterStatus(final Status afterStatus) {
104 | 0 |
             this.afterStatus = afterStatus;
105 | 0 |
         }
106 |  |
107 |  |
         /**
108 |  |
          * @return Returns the beforeStatus.
109 |  |
          */
110 |  |
         public Status getBeforeStatus() {
111 | 1330 |
             return beforeStatus;
112 |  |
         }
113 |  |
114 |  |
         /**
115 |  |
          * @param beforeStatus The beforeStatus to set.
116 |  |
          */
117 |  |
         public void setBeforeStatus(final Status beforeStatus) {
118 | 0 |
             this.beforeStatus = beforeStatus;
119 | 0 |
         }
120 |  |
121 |  |
         /**
122 |  |
          * @return Returns the entryList.
123 |  |
          */
124 |  |
         public List getEntryList() {
125 | 632 |
             return entryList;
126 |  |
         }
127 |  |
128 |  |
         /**
129 |  |
          * @return Returns the exitList.
130 |  |
          */
131 |  |
         public List getExitList() {
132 | 848 |
             return exitList;
133 |  |
         }
134 |  |
135 |  |
         /**
136 |  |
          * @return Returns the externalEvents.
137 |  |
          */
138 |  |
         public Collection getExternalEvents() {
139 | 532 |
             return externalEvents;
140 |  |
         }
141 |  |
142 |  |
         /**
143 |  |
          * @return Returns the transitList.
144 |  |
          */
145 |  |
         public List getTransitList() {
146 | 1776 |
             return transitList;
147 |  |
         }
148 |  |
149 |  |
     }
150 |  |