cdqa.object
Class XObject

java.lang.Object
  extended by cdqa.object.XObject
Direct Known Subclasses:
XAtomic, XDOMObject

public abstract class XObject
extends java.lang.Object

The base class for cdqa objects.

Version:
$Id: XObject.java,v 1.3 2006/01/24 17:31:50 simonkm Exp $
Author:
$Author: simonkm $

Field Summary
protected static java.util.logging.Logger LOGGER
           
static short TYPE_ATTR
           
static short TYPE_BOOLEAN
           
static short TYPE_DOCUMENT
           
static short TYPE_DOUBLE
           
static short TYPE_ELEMENT
           
static short TYPE_END
           
static short TYPE_INTEGER
           
static short TYPE_STRING
           
static short TYPE_TEXT
           
 
Constructor Summary
XObject()
           
 
Method Summary
 XBoolean asBoolean()
          Convert this XObject into a XBoolean.
 XDouble asDouble()
          Convert this XObject into a XDouble.
 XInteger asInteger()
          Convert this XObject into a XInteger.
 XString asString()
          Convert this XObject into a XString.
(package private) abstract  boolean booleanValue()
           
abstract  org.w3c.dom.Node createDOMClone()
          creates a clone of this object
(package private) abstract  double doubleValue()
           
(package private) abstract  java.lang.String fullText()
           
abstract  XElement getDocumentElement()
          The root element of the document this object belongs to, if any.
 XString getFullText()
          Convert this XObject into a XString.
 XString getLabel()
          The label of this object.
abstract  XString getNodeName()
          Returns a XString containing the node name of this XObject as defined in the W3C recommandation, if this XObject wraps a DOM object.
abstract  XDocument getOwnerDocument(IRepository repository)
          The document this object belongs to, if any.
abstract  XDOMObject getParentNode()
          Returns the parent object of this object null if this object has no parent
abstract  short getType()
          Returns the type of this object.
(package private) abstract  int intValue()
           
abstract  boolean isAtomic()
          f Returns true iff this object is atomic
abstract  boolean isDOM()
          Returns true iff this object is a DOM object
static boolean isEND(XObject o)
          Returns true iff o is the XObject is END
static boolean isFALSE(XObject o)
          Returns true iff o is the XBoolean FALSE
static boolean isTRUE(XObject o)
          Returns true iff o is the XBoolean TRUE
abstract  XString pathTo(XObject o)
          Returns the path to this object.
abstract  void print(XObjectWriter w)
          output
(package private) abstract  java.lang.String shortText()
           
(package private) abstract  java.lang.String stringValue()
           
static XObject theENDObject()
           
abstract  boolean valueCompare(XObject o)
           
static boolean valueCompare(XObject o1, XObject o2)
          performs a comparison by value between two XObjects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final java.util.logging.Logger LOGGER

TYPE_END

public static final short TYPE_END
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final short TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_INTEGER

public static final short TYPE_INTEGER
See Also:
Constant Field Values

TYPE_DOUBLE

public static final short TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_STRING

public static final short TYPE_STRING
See Also:
Constant Field Values

TYPE_TEXT

public static final short TYPE_TEXT
See Also:
Constant Field Values

TYPE_ATTR

public static final short TYPE_ATTR
See Also:
Constant Field Values

TYPE_ELEMENT

public static final short TYPE_ELEMENT
See Also:
Constant Field Values

TYPE_DOCUMENT

public static final short TYPE_DOCUMENT
See Also:
Constant Field Values
Constructor Detail

XObject

public XObject()
Method Detail

theENDObject

public static final XObject theENDObject()
Returns:
END

getType

public abstract short getType()
Returns the type of this object. see the enumeration in XObject class


isAtomic

public abstract boolean isAtomic()
f Returns true iff this object is atomic


isDOM

public abstract boolean isDOM()
Returns true iff this object is a DOM object


getParentNode

public abstract XDOMObject getParentNode()
Returns the parent object of this object null if this object has no parent


getOwnerDocument

public abstract XDocument getOwnerDocument(IRepository repository)
The document this object belongs to, if any. null otherwise


getDocumentElement

public abstract XElement getDocumentElement()
The root element of the document this object belongs to, if any. null otherwise.


pathTo

public abstract XString pathTo(XObject o)
Returns the path to this object. It is a XString of the form "this/label1/.../labels" null if this object does not actually belong to any document


getLabel

public final XString getLabel()
The label of this object. Returns getNodeName() for XElements and XAttrs null otherwise


getNodeName

public abstract XString getNodeName()
Returns a XString containing the node name of this XObject as defined in the W3C recommandation, if this XObject wraps a DOM object. null otherwise


createDOMClone

public abstract org.w3c.dom.Node createDOMClone()
creates a clone of this object


booleanValue

abstract boolean booleanValue()
                       throws CastException
Throws:
CastException

intValue

abstract int intValue()
               throws CastException
Throws:
CastException

doubleValue

abstract double doubleValue()
                     throws CastException
Throws:
CastException

stringValue

abstract java.lang.String stringValue()

shortText

abstract java.lang.String shortText()

fullText

abstract java.lang.String fullText()

asBoolean

public final XBoolean asBoolean()
Convert this XObject into a XBoolean.


asInteger

public final XInteger asInteger()
Convert this XObject into a XInteger.


asDouble

public final XDouble asDouble()
Convert this XObject into a XDouble.


asString

public final XString asString()
Convert this XObject into a XString.


getFullText

public final XString getFullText()
Convert this XObject into a XString.


valueCompare

public abstract boolean valueCompare(XObject o)

valueCompare

public static final boolean valueCompare(XObject o1,
                                         XObject o2)
performs a comparison by value between two XObjects.


isTRUE

public static final boolean isTRUE(XObject o)
Returns true iff o is the XBoolean TRUE


isFALSE

public static final boolean isFALSE(XObject o)
Returns true iff o is the XBoolean FALSE


isEND

public static final boolean isEND(XObject o)
Returns true iff o is the XObject is END


print

public abstract void print(XObjectWriter w)
output