##### Coverage Report - org.apache.commons.scxml.model.Datamodel

Classes in this File | Line Coverage | Branch Coverage | Complexity
Datamodel |
100% |
100% |
| 1.3333333333333333;1.333

1 |  |
     /*
2 |  |
      *
3 |  |
      *   Copyright 2006 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.model;
19 |  |
20 |  |
     import java.util.ArrayList;
21 |  |
     import java.util.List;
22 |  |
23 |  |
     /**
24 |  |
      * The class in this SCXML object model that corresponds to the SCXML
25 |  |
      * &lt;datamodel&gt; element.
26 |  |
      *
27 |  |
      */
28 |  |
     public class Datamodel {
29 |  |
30 |  |
        /**
31 |  |
         * The set of &lt;data&gt; elements, parsed as Elements, that are
32 |  |
         * children of this &lt;datamodel&gt; element.
33 |  |
         */
34 |  |
        private List data;
35 |  |
36 |  |
        /**
37 |  |
         * Constructor.
38 |  |
         */
39 | 9 |
        public Datamodel() {
40 | 9 |
            this.data = new ArrayList();
41 | 9 |
        }
42 |  |
43 |  |
        /**
44 |  |
         * Get all the data children of this datamodel.
45 |  |
         *
46 |  |
         * @return Returns the data.
47 |  |
         */
48 |  |
        public final List getData() {
49 | 9 |
            return data;
50 |  |
        }
51 |  |
52 |  |
        /**
53 |  |
         * Add a Data.
54 |  |
         *
55 |  |
         * @param datum The data child to be added.
56 |  |
         */
57 |  |
        public final void addData(final Data datum) {
58 | 14 |
            if (datum != null) {
59 | 14 |
                data.add(datum);
60 |  |
            }
61 | 14 |
        }
62 |  |
63 |  |
     }
64 |  |