1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
package com.wutka.dtd;
import java.io.*;
/** Represents a Notation defined in a DTD
*
* @author Mark Wutka
* @version $Revision: 1.16 $ $Date: 2002/07/19 01:20:11 $ by $Author: wutka $
*/
public class DTDNotation implements DTDOutput
{
public String name;
public DTDExternalID externalID;
public DTDNotation()
{
}
public DTDNotation(String aName)
{
name = aName;
}
/** Writes out a declaration for this notation */
public void write(PrintWriter out)
throws IOException
{
out.print("<!NOTATION ");
out.print(name);
out.print(" ");
externalID.write(out);
out.println(">");
}
public boolean equals(Object ob)
{
if (ob == this) return true;
if (!(ob instanceof DTDNotation)) return false;
DTDNotation other = (DTDNotation) ob;
if (name == null)
{
if (other.name != null) return false;
}
else
{
if (!name.equals(other.name)) return false;
}
if (externalID == null)
{
if (other.externalID != null) return false;
}
else
{
if (!externalID.equals(other.externalID)) return false;
}
return true;
}
/** Sets the notation name */
public void setName(String aName)
{
name = aName;
}
/** Retrieves the notation name */
public String getName()
{
return name;
}
/** Sets the external ID */
public void setExternalID(DTDExternalID theExternalID)
{
externalID = theExternalID;
}
/** Retrieves the external ID */
public DTDExternalID getExternalID()
{
return externalID;
}
}
|