1 package com.wutka.dtd;
2
3 import java.io.*;
4
5 /*** Represents a named item in the DTD
6 *
7 * @author Mark Wutka
8 * @version $Revision: 1.16 $ $Date: 2002/07/19 01:20:11 $ by $Author: wutka $
9 */
10 public class DTDName extends DTDItem
11 {
12 public String value;
13
14 public DTDName()
15 {
16 }
17
18 public DTDName(String aValue)
19 {
20 value = aValue;
21 }
22
23 /*** Writes out the value of this name */
24 public void write(PrintWriter out)
25 throws IOException
26 {
27 out.print(value);
28 cardinal.write(out);
29 }
30
31 public boolean equals(Object ob)
32 {
33 if (ob == this) return true;
34 if (!(ob instanceof DTDName)) return false;
35 if (!super.equals(ob)) return false;
36
37 DTDName other = (DTDName) ob;
38
39 if (value == null)
40 {
41 if (other.value != null) return false;
42 }
43 else
44 {
45 if (!value.equals(other.value)) return false;
46 }
47 return true;
48 }
49
50 /*** Sets the name value */
51 public void setValue(String aValue)
52 {
53 value = aValue;
54 }
55
56 /*** Retrieves the name value */
57 public String getValue()
58 {
59 return value;
60 }
61 }