cdqa.object

Class XObject

Known Direct 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 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

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 Node
createDOMClone()
creates a clone of this object
(package private) abstract double
doubleValue()
(package private) abstract 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 String
shortText()
(package private) abstract 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.

Field Details

LOGGER

protected static final Logger LOGGER

TYPE_ATTR

public static final short TYPE_ATTR
Field Value:
6

TYPE_BOOLEAN

public static final short TYPE_BOOLEAN
Field Value:
1

TYPE_DOCUMENT

public static final short TYPE_DOCUMENT
Field Value:
8

TYPE_DOUBLE

public static final short TYPE_DOUBLE
Field Value:
3

TYPE_ELEMENT

public static final short TYPE_ELEMENT
Field Value:
7

TYPE_END

public static final short TYPE_END
Field Value:
-1

TYPE_INTEGER

public static final short TYPE_INTEGER
Field Value:
2

TYPE_STRING

public static final short TYPE_STRING
Field Value:
4

TYPE_TEXT

public static final short TYPE_TEXT
Field Value:
5

Method Details

asBoolean

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

asDouble

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

asInteger

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

asString

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

booleanValue

(package private)  abstract boolean booleanValue()
            throws CastException

createDOMClone

public abstract Node createDOMClone()
creates a clone of this object

doubleValue

(package private)  abstract double doubleValue()
            throws CastException

fullText

(package private)  abstract String fullText()

getDocumentElement

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

getFullText

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

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

getOwnerDocument

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

getParentNode

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

getType

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

intValue

(package private)  abstract int intValue()
            throws CastException

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

isEND

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

isFALSE

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

isTRUE

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

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

print

public abstract void print(XObjectWriter w)
output

shortText

(package private)  abstract String shortText()

stringValue

(package private)  abstract String stringValue()

theENDObject

public static final XObject theENDObject()
Returns:
END

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.