com.wutka.dtd
Class DTDContainer

java.lang.Object
  |
  +--com.wutka.dtd.DTDItem
        |
        +--com.wutka.dtd.DTDContainer
All Implemented Interfaces:
DTDOutput
Direct Known Subclasses:
DTDChoice, DTDMixed, DTDSequence

public abstract class DTDContainer
extends DTDItem

Represents an item that may contain other items (such as a DTDChoice or a DTDSequence)

Version:
$Revision: 1.12 $ $Date: 2000/09/01 13:21:05 $ by $Author: wutka $
Author:
Mark Wutka

Field Summary
protected  Vector items
           
 
Fields inherited from class com.wutka.dtd.DTDItem
cardinal
 
Constructor Summary
DTDContainer()
          Creates a new DTDContainer
 
Method Summary
 void add(DTDItem item)
          Adds an element to the container
 boolean equals(Object ob)
           
 DTDItem[] getItem()
          Retrieves the items in the container
 DTDItem getItem(int i)
          Retrieves an item from the container
 DTDItem[] getItems()
          Returns the elements as an array of items
 Vector getItemsVec()
          Returns the elements as a vector (not a clone!)
 void remove(DTDItem item)
          Removes an element from the container
 void setItem(DTDItem[] newItems)
          Stores items in the container
 void setItem(DTDItem anItem, int i)
          Stores an item in the container
abstract  void write(PrintWriter out)
          Writes out a declaration for this item
 
Methods inherited from class com.wutka.dtd.DTDItem
getCardinal, setCardinal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

protected Vector items
Constructor Detail

DTDContainer

public DTDContainer()
Creates a new DTDContainer
Method Detail

add

public void add(DTDItem item)
Adds an element to the container

remove

public void remove(DTDItem item)
Removes an element from the container

getItemsVec

public Vector getItemsVec()
Returns the elements as a vector (not a clone!)

getItems

public DTDItem[] getItems()
Returns the elements as an array of items

equals

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

setItem

public void setItem(DTDItem[] newItems)
Stores items in the container

getItem

public DTDItem[] getItem()
Retrieves the items in the container

setItem

public void setItem(DTDItem anItem,
                    int i)
Stores an item in the container

getItem

public DTDItem getItem(int i)
Retrieves an item from the container

write

public abstract void write(PrintWriter out)
                    throws IOException
Description copied from class: DTDItem
Writes out a declaration for this item
Overrides:
write in class DTDItem