Coverage details for umich.cac.data.Attribute

LineHitsSource
1 package umich.cac.data;
2  
3 /**
4  * Used to encode attributes
5  *
6  * @author rmach@umich.edu
7  * @version $Header: /cvsroot/pbsaccounting/pbsaccounting/src/umich/cac/data/Attribute.java,v 1.2 2003/10/21 19:08:00 rodmach Exp $
8  */
9 public class Attribute {
10  
11     /* The name of the attribute */
1275    private String name = null;
13     /* The value of the attribute */
1475    private String value = null;
15  
16     /**
17      * Constructor, represents an attribute for a field like ppn=8 where ppn is
18      * the name, and 8 is the value
19      *
20      * @param name
21      * the name of the attribute
22      * @param value
23      * the value for the attribute
24      */
2575    public Attribute(String name, String value) {
26  
2775        if (name == null || value == null) {
280            throw new IllegalArgumentException("arguments can not be null");
29         }
30  
3175        this.name = name;
3275        this.value = value;
3375    }
34  
35     /**
36      * toXML() formats the attribute in an XML style, ala name="value" Return
37      * the attribute in XML attribute style
38      */
39     public String toXML() {
4075        return name + "=" + "\"" + value + "\"";
41     }
42  
43 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.