Line | Hits | Source |
---|---|---|
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 */ | |
12 | 75 | private String name = null; |
13 | /* The value of the attribute */ | |
14 | 75 | 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 | */ | |
25 | 75 | public Attribute(String name, String value) { |
26 | ||
27 | 75 | if (name == null || value == null) { |
28 | 0 | throw new IllegalArgumentException("arguments can not be null"); |
29 | } | |
30 | ||
31 | 75 | this.name = name; |
32 | 75 | this.value = value; |
33 | 75 | } |
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() { | |
40 | 75 | return name + "=" + "\"" + value + "\""; |
41 | } | |
42 | ||
43 | } |
this report was generated by version 1.0.5 of jcoverage. |
copyright © 2003, jcoverage ltd. all rights reserved. |