Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.merlotxml.util.xml.xml4j
Class DTDElementImpl  view DTDElementImpl download DTDElementImpl.java

java.lang.Object
  extended byorg.merlotxml.util.xml.xml4j.DTDElementImpl
All Implemented Interfaces:
java.lang.Comparable, org.merlotxml.util.xml.DTDElement

public class DTDElementImpl
extends java.lang.Object
implements org.merlotxml.util.xml.DTDElement, java.lang.Comparable

A DTDDocument based on the XML 4j package

Version:
$Id: DTDElementImpl.java,v 1.1.1.1 2001/07/02 15:41:28 flament Exp $

Field Summary
private  java.util.Vector _attrs
           
private  DTD _doc
           
private  java.lang.String _name
           
 
Constructor Summary
DTDElementImpl(DTD doc, ElementDecl decl)
           
 
Method Summary
 int compareTo(java.lang.Object o)
          Compares this object with another, and returns a numerical result based on the comparison.
 org.merlotxml.util.xml.DTDAttribute getAttribute(java.lang.String name)
          Returns a single named attribute for this element
 java.util.Enumeration getAttributes()
          Returns the list of attributes
 org.merlotxml.util.xml.DTDContentSpec getContentSpec()
          Returns the content spec of the element.
 java.lang.String getName()
          Returns the name of this element
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_doc

private DTD _doc

_name

private java.lang.String _name

_attrs

private java.util.Vector _attrs
Constructor Detail

DTDElementImpl

public DTDElementImpl(DTD doc,
                      ElementDecl decl)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: org.merlotxml.util.xml.DTDElement
Returns the name of this element

Specified by:
getName in interface org.merlotxml.util.xml.DTDElement

getAttributes

public java.util.Enumeration getAttributes()
Description copied from interface: org.merlotxml.util.xml.DTDElement
Returns the list of attributes

Specified by:
getAttributes in interface org.merlotxml.util.xml.DTDElement

getAttribute

public org.merlotxml.util.xml.DTDAttribute getAttribute(java.lang.String name)
Description copied from interface: org.merlotxml.util.xml.DTDElement
Returns a single named attribute for this element

Specified by:
getAttribute in interface org.merlotxml.util.xml.DTDElement

getContentSpec

public org.merlotxml.util.xml.DTDContentSpec getContentSpec()
Description copied from interface: org.merlotxml.util.xml.DTDElement
Returns the content spec of the element. Should not be used and will probably go away

Specified by:
getContentSpec in interface org.merlotxml.util.xml.DTDElement

compareTo

public int compareTo(java.lang.Object o)
Description copied from interface: java.lang.Comparable
Compares this object with another, and returns a numerical result based on the comparison. If the result is negative, this object sorts less than the other; if 0, the two are equal, and if positive, this object sorts greater than the other. To translate this into boolean, simply perform o1.compareTo(o2) <op> 0, where op is one of <, <=, =, !=, >, or >=.

You must make sure that the comparison is mutual, ie. sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) (where sgn() is defined as -1, 0, or 1 based on the sign). This includes throwing an exception in either direction if the two are not comparable; hence, compareTo(null) should always throw an Exception.

You should also ensure transitivity, in two forms: x.compareTo(y) > 0 && y.compareTo(z) > 0 implies x.compareTo(z) > 0; and x.compareTo(y) == 0 implies x.compareTo(z) == y.compareTo(z).

Specified by:
compareTo in interface java.lang.Comparable