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

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

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