Clover coverage report - Code Coverage for hivemind release 1.0-rc-2
Coverage timestamp: Sat Sep 11 2004 09:09:48 EDT
file stats: LOC: 98   Methods: 8
NCLOC: 62   Classes: 1
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover
 
 Source file Conditionals Statements Methods TOTAL
ElementModelImpl.java 91.7% 100% 100% 97.4%
coverage coverage
 1   
 //  Copyright 2004 The Apache Software Foundation
 2   
 //
 3   
 // Licensed under the Apache License, Version 2.0 (the "License");
 4   
 // you may not use this file except in compliance with the License.
 5   
 // You may obtain a copy of the License at
 6   
 //
 7   
 //     http://www.apache.org/licenses/LICENSE-2.0
 8   
 //
 9   
 // Unless required by applicable law or agreed to in writing, software
 10   
 // distributed under the License is distributed on an "AS IS" BASIS,
 11   
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 12   
 // See the License for the specific language governing permissions and
 13   
 // limitations under the License.
 14   
 
 15   
 package org.apache.hivemind.schema.impl;
 16   
 
 17   
 import java.util.ArrayList;
 18   
 import java.util.Collections;
 19   
 import java.util.List;
 20   
 
 21   
 import org.apache.hivemind.schema.AttributeModel;
 22   
 import org.apache.hivemind.schema.ElementModel;
 23   
 import org.apache.hivemind.schema.Rule;
 24   
 
 25   
 /**
 26   
  * Implementation of {@link org.apache.hivemind.schema.ElementModel}.
 27   
  *
 28   
  * @author Howard Lewis Ship
 29   
  */
 30   
 public class ElementModelImpl extends SchemaImpl implements ElementModel
 31   
 {
 32   
     private String _elementName;
 33   
     private List _attributeModels;
 34   
     private List _shareableAttributeModels;
 35   
     private List _rules;
 36   
     private List _shareableRules;
 37   
     private String _contentTranslator;
 38   
     
 39  7401
     public String getElementName()
 40   
     {
 41  7401
         return _elementName;
 42   
     }
 43   
 
 44  2887
     public void setElementName(String string)
 45   
     {
 46  2887
         _elementName = string;
 47   
     }
 48   
 
 49  3781
     public void addAttributeModel(AttributeModel attributeModel)
 50   
     {
 51  3781
         if (_attributeModels == null)
 52  1613
             _attributeModels = new ArrayList();
 53   
 
 54  3781
         _attributeModels.add(attributeModel);
 55  3781
         _shareableAttributeModels = null;
 56   
     }
 57   
 
 58  7886
     public List getAttributeModels()
 59   
     {
 60  7886
         if (_shareableAttributeModels == null)
 61  2565
             _shareableAttributeModels =
 62  2565
                 _attributeModels == null
 63   
                     ? Collections.EMPTY_LIST
 64   
                     : Collections.unmodifiableList(_attributeModels);
 65   
 
 66  7886
         return _shareableAttributeModels;
 67   
     }
 68   
 
 69  11308
     public void addRule(Rule rule)
 70   
     {
 71  11308
         if (_rules == null)
 72  2884
             _rules = new ArrayList();
 73   
 
 74  11308
         _rules.add(rule);
 75  11308
         _shareableRules = null;
 76   
     }
 77   
 
 78  5456
     public List getRules()
 79   
     {
 80  5456
         if (_shareableRules == null)
 81  679
             _shareableRules =
 82  679
                 _rules == null ? Collections.EMPTY_LIST : Collections.unmodifiableList(_rules);
 83   
 
 84  5456
         return _shareableRules;
 85   
     }
 86   
     
 87  10
     public String getContentTranslator()
 88   
     {
 89  10
         return _contentTranslator;
 90   
     }
 91   
 
 92  2885
     public void setContentTranslator(String string)
 93   
     {
 94  2885
         _contentTranslator = string;
 95   
     }
 96   
 
 97   
 }
 98