Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.xpath.objects
Class XObject

    java.lang.Object
      |
      +--org.apache.xpath.Expression
            |
            +--org.apache.xpath.objects.XObject

Direct Known Subclasses:
  XBoolean, XNodeSet, XNull, XNumber, XRTreeFrag, XString

public class XObject
extends Expression
implements java.io.Serializable

This class represents an XPath object, and is capable of converting the object to various types, such as a string. This class acts as the base class to other XPath type objects, such as XString, and provides polymorphic casting capabilities.

See Also:
  Serialized Form

Field Summary
`static int` | `CLASS_BOOLEAN`
`static int` | `CLASS_NODESET`
`static int` | `CLASS_NULL`
`static int` | `CLASS_NUMBER`
`static int` | `CLASS_RTREEFRAG`
`static int` | `CLASS_STRING`
`static int` | `CLASS_UNKNOWN`

Constructor Summary
`XObject()` Create an XObject.
`XObject(java.lang.Object obj)` Create an XObject.

Method Summary
`boolean` | `bool()` Cast result object to a boolean.
`java.lang.Object` | `castToType(int t, XPathContext support)` Cast object to type t.
`static XObject` | `create(java.lang.Object val)` Create the right XObject based on the type of the object passed.
`boolean` | `equals(XObject obj2)` Tell if two objects are functionally equal.
`XObject` | `execute(XPathContext xctxt)` For support of literal objects in xpaths.
`int` | `getType()` Tell what kind of class this is.
`boolean` | `greaterThan(XObject obj2)` Tell if one object is less than the other.
`boolean` | `greaterThanOrEqual(XObject obj2)` Tell if one object is less than the other.
`boolean` | `lessThan(XObject obj2)` Tell if one object is less than the other.
`boolean` | `lessThanOrEqual(XObject obj2)` Tell if one object is less than or equal to the other.
`NodeSet` | `mutableNodeset()` Cast result object to a nodelist.
`NodeIterator` | `nodeset()` Cast result object to a nodelist.
`boolean` | `notEquals(XObject obj2)` Tell if two objects are functionally not equal.
`double` | `num()` Cast result object to a number.
`java.lang.Object` | `object()` Return a java object that's closes to the represenation that should be handed to an extension.
`DocumentFragment` | `rtree()` For functions to override.
`DocumentFragment` | `rtree(XPathContext support)` Cast result object to a result tree fragment.
`java.lang.String` | `str()` Cast result object to a string.
`java.lang.String` | `toString()`

Methods inherited from class org.apache.xpath.Expression
`assert, error, warn`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### CLASS_NULL

    public static final int CLASS_NULL

### CLASS_UNKNOWN

    public static final int CLASS_UNKNOWN

### CLASS_BOOLEAN

    public static final int CLASS_BOOLEAN

### CLASS_NUMBER

    public static final int CLASS_NUMBER

### CLASS_STRING

    public static final int CLASS_STRING

### CLASS_NODESET

    public static final int CLASS_NODESET

### CLASS_RTREEFRAG

    public static final int CLASS_RTREEFRAG

Constructor Detail

### XObject

    public XObject()

  Create an XObject.

### XObject

    public XObject(java.lang.Object obj)

  Create an XObject.

Method Detail

### execute

    public XObject execute(XPathContext xctxt)
                    throws SAXException

  For support of literal objects in xpaths.
  Overrides:
    execute in class Expression

### create

    public static XObject create(java.lang.Object val)

  Create the right XObject based on the type of the object passed.

### getType

    public int getType()

  Tell what kind of class this is.

### num

    public double num()
               throws SAXException

  Cast result object to a number.

### bool

    public boolean bool()
                 throws SAXException

  Cast result object to a boolean.

### str

    public java.lang.String str()

  Cast result object to a string.

### toString

    public java.lang.String toString()

  Overrides:
    toString in class java.lang.Object

### rtree

    public DocumentFragment rtree(XPathContext support)

  Cast result object to a result tree fragment.

### rtree

    public DocumentFragment rtree()

  For functions to override.

### object

    public java.lang.Object object()

  Return a java object that's closes to the represenation that should be handed to an extension.

### nodeset

    public NodeIterator nodeset()
                         throws SAXException

  Cast result object to a nodelist.

### mutableNodeset

    public NodeSet mutableNodeset()
                           throws SAXException

  Cast result object to a nodelist.

### castToType

    public java.lang.Object castToType(int t,
                                       XPathContext support)
                                throws SAXException

  Cast object to type t.

### lessThan

    public boolean lessThan(XObject obj2)
                     throws SAXException

  Tell if one object is less than the other.

### lessThanOrEqual

    public boolean lessThanOrEqual(XObject obj2)
                            throws SAXException

  Tell if one object is less than or equal to the other.

### greaterThan

    public boolean greaterThan(XObject obj2)
                        throws SAXException

  Tell if one object is less than the other.

### greaterThanOrEqual

    public boolean greaterThanOrEqual(XObject obj2)
                               throws SAXException

  Tell if one object is less than the other.

### equals

    public boolean equals(XObject obj2)
                   throws SAXException

  Tell if two objects are functionally equal.

### notEquals

    public boolean notEquals(XObject obj2)
                      throws SAXException

  Tell if two objects are functionally not equal.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000 Apache XML Project. All Rights Reserved.