com.wutka.dtd
Class DTDCardinal

java.lang.Object
  |
  +--com.wutka.dtd.DTDCardinal
All Implemented Interfaces:
DTDOutput

public class DTDCardinal
extends Object
implements DTDOutput

Represents the various cardinality values for a DTD item.

  • NONE indicates no cardinality
  • OPTIONAL indicates an optional value (specified by ?)
  • ZEROMANY indicates zero-to-many values (specified by *)
  • ONEMANY indicates an one-to-many values (specified by +)
  • Version:
    $Revision: 1.12 $ $Date: 2000/09/01 13:21:05 $ by $Author: wutka $
    Author:
    Mark Wutka

    Field Summary
     String name
               
    static DTDCardinal NONE
              Indicates no cardinality (implies a single object)
    static DTDCardinal ONEMANY
              Indicates that there can be one-to-many occurrances of an item
    static DTDCardinal OPTIONAL
              Indicates that an item is optional (zero-to-one)
     int type
               
    static DTDCardinal ZEROMANY
              Indicates that there can be zero-to-many occurrances of an item
     
    Constructor Summary
    DTDCardinal(int aType, String aName)
               
     
    Method Summary
     boolean equals(Object ob)
               
     void write(PrintWriter out)
              Writes the notation for this cardinality value
     
    Methods inherited from class java.lang.Object
    clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Field Detail

    NONE

    public static final DTDCardinal NONE
    Indicates no cardinality (implies a single object)

    OPTIONAL

    public static final DTDCardinal OPTIONAL
    Indicates that an item is optional (zero-to-one)

    ZEROMANY

    public static final DTDCardinal ZEROMANY
    Indicates that there can be zero-to-many occurrances of an item

    ONEMANY

    public static final DTDCardinal ONEMANY
    Indicates that there can be one-to-many occurrances of an item

    type

    public int type

    name

    public String name
    Constructor Detail

    DTDCardinal

    public DTDCardinal(int aType,
                       String aName)
    Method Detail

    equals

    public boolean equals(Object ob)
    Overrides:
    equals in class Object

    write

    public void write(PrintWriter out)
               throws IOException
    Writes the notation for this cardinality value
    Specified by:
    write in interface DTDOutput