Clover coverage report - JBind Project
Coverage timestamp: Fr Mai 28 2004 11:17:36 CEST
file stats: LOC: 62   Methods: 8
NCLOC: 40   Classes: 1
This license of Clover is provided to support the development of JBind only. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover.
 
 Source file Conditionals Statements Methods TOTAL
Attributes.java 0% 35,7% 50% 37,5%
 1   
 /*
 2   
  * JBind
 3   
  *
 4   
  * Copyright (c) by Stefan Wachter. All rights reserved.
 5   
  *
 6   
  * Usage, modification, and redistribution is subject to license terms that are
 7   
  * available at 'http://www.jbind.org'. The JBind license is like the
 8   
  * 'Apache Software License V 1.1'.
 9   
  */
 10   
 package org.jbind.xml.schema.element;
 11   
 
 12   
 import java.util.HashMap;
 13   
 import java.util.Iterator;
 14   
 import java.util.Map;
 15   
 
 16   
 import org.jbind.util.other.StrBuffer;
 17   
 import org.jbind.xml.base.IAttribute;
 18   
 import org.jbind.xml.base.IAttributes;
 19   
 
 20   
 public class Attributes implements IAttributes {
 21   
 
 22   
   private Map myAttributes = new HashMap(23);
 23   
 
 24  6540
   public Attributes() {}
 25   
 
 26  0
   public Iterator iterAttributes() {
 27  0
     return myAttributes.values().iterator();
 28   
   }
 29   
 
 30  0
   public String getStringValue(String aName) {
 31  0
     return getStringValue(null, aName);
 32   
   }
 33   
 
 34  113597
   private String getKey(String aNamespace, String aName) {
 35  113597
     StrBuffer key = new StrBuffer(50);
 36  113597
     key.append((null == aNamespace) ? "" : aNamespace).append(':').append(aName);
 37  113597
     return key.toString();
 38   
   }
 39   
 
 40  0
   public String getStringValue(String aNamespace, String aName) {
 41  0
     String res = null;
 42  0
     String key = getKey(aNamespace, aName);
 43  0
     IAttribute attribute = (IAttribute)myAttributes.get(key);
 44  0
     if (null != attribute) {
 45  0
       res = attribute.getStringValue();
 46   
     }
 47  0
     return res;
 48   
   }
 49   
 
 50  7298
   public void addAttribute(IAttribute anAttribute) {
 51  7298
     myAttributes.put(getKey(anAttribute.getNamespaceUri(), anAttribute.getLocalName()), anAttribute);
 52   
   }
 53   
 
 54  0
   public void removeAttribute(String aNamespace, String aName) {
 55  0
     myAttributes.remove(getKey(aNamespace, aName));
 56   
   }
 57   
 
 58  106299
   public IAttribute getAttribute(String aNamespace, String aName) {
 59  106299
     return (IAttribute)myAttributes.get(getKey(aNamespace, aName));
 60   
   }
 61   
 }
 62