org.apache.xpath.objects

Class XNodeSet

public class XNodeSet extends NodeSequence

This class represents an XPath nodeset object, and is capable of converting the nodeset to other types, such as a string.

UNKNOWN: general

Constructor Summary
XNodeSet(DTMIterator val)
Construct a XNodeSet object.
XNodeSet(XNodeSet val)
Construct a XNodeSet object.
XNodeSet(DTMManager dtmMgr)
Construct an empty XNodeSet object.
XNodeSet(int n, DTMManager dtmMgr)
Construct a XNodeSet object for one node.
Method Summary
voidappendToFsb(FastStringBuffer fsb)
Cast result object to a string.
booleanbool()
Cast result object to a boolean.
booleanboolWithSideEffects()
Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator.
booleancompare(XObject obj2, Comparator comparator)
Tell if one object is less than the other.
voiddispatchCharactersEvents(ContentHandler ch)
Directly call the characters method on the passed ContentHandler for the string-value.
booleanequals(XObject obj2)
Tell if two objects are functionally equal.
XObjectgetFresh()
Get a fresh copy of the object.
doublegetNumberFromNode(int n)
Get numeric value of the string conversion from a single node.
XMLStringgetStringFromNode(int n)
Get the string conversion from a single node.
intgetType()
Tell that this is a CLASS_NODESET.
StringgetTypeString()
Given a request type, return the equivalent string.
booleangreaterThan(XObject obj2)
Tell if one object is less than the other.
booleangreaterThanOrEqual(XObject obj2)
Tell if one object is less than the other.
DTMIteratoriter()
Cast result object to a nodelist.
DTMIteratoriterRaw()
Return the iterator without cloning, etc.
booleanlessThan(XObject obj2)
Tell if one object is less than the other.
booleanlessThanOrEqual(XObject obj2)
Tell if one object is less than or equal to the other.
NodeSetDTMmutableNodeset()
Cast result object to a mutableNodeset.
NodeListnodelist()
Cast result object to a nodelist.
NodeIteratornodeset()
Cast result object to a nodelist.
booleannotEquals(XObject obj2)
Tell if two objects are functionally not equal.
doublenum()
Cast result object to a number.
doublenumWithSideEffects()
Cast result object to a number, but allow side effects, such as the incrementing of an iterator.
Objectobject()
Return a java object that's closest to the representation that should be handed to an extension.
voidrelease(DTMIterator iter)
Stringstr()
Cast result object to a string.
XMLStringxstr()
Cast result object to an XMLString.

Constructor Detail

XNodeSet

public XNodeSet(DTMIterator val)
Construct a XNodeSet object.

Parameters: val Value of the XNodeSet object

XNodeSet

public XNodeSet(XNodeSet val)
Construct a XNodeSet object.

Parameters: val Value of the XNodeSet object

XNodeSet

public XNodeSet(DTMManager dtmMgr)
Construct an empty XNodeSet object. This is used to create a mutable nodeset to which random nodes may be added.

XNodeSet

public XNodeSet(int n, DTMManager dtmMgr)
Construct a XNodeSet object for one node.

Parameters: n Node to add to the new XNodeSet object

Method Detail

appendToFsb

public void appendToFsb(FastStringBuffer fsb)
Cast result object to a string.

Returns: The string this wraps or the empty string if null

bool

public boolean bool()
Cast result object to a boolean.

Returns: True if there is a next node in the nodeset

boolWithSideEffects

public boolean boolWithSideEffects()
Cast result object to a boolean, but allow side effects, such as the incrementing of an iterator.

Returns: True if there is a next node in the nodeset

compare

public boolean compare(XObject obj2, Comparator comparator)
Tell if one object is less than the other.

Parameters: obj2 Object to compare this nodeset to comparator Comparator to use

Returns: See the comments below for each object type comparison

Throws: javax.xml.transform.TransformerException

dispatchCharactersEvents

public void dispatchCharactersEvents(ContentHandler ch)
Directly call the characters method on the passed ContentHandler for the string-value. Multiple calls to the ContentHandler's characters methods may well occur for a single call to this method.

Parameters: ch A non-null reference to a ContentHandler.

Throws: org.xml.sax.SAXException

equals

public boolean equals(XObject obj2)
Tell if two objects are functionally equal.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

getFresh

public XObject getFresh()
Get a fresh copy of the object. For use with variables.

Returns: A fresh nodelist.

getNumberFromNode

public double getNumberFromNode(int n)
Get numeric value of the string conversion from a single node.

Parameters: n Node to convert

Returns: numeric value of the string conversion from a single node.

getStringFromNode

public XMLString getStringFromNode(int n)
Get the string conversion from a single node.

Parameters: n Node to convert

Returns: the string conversion from a single node.

getType

public int getType()
Tell that this is a CLASS_NODESET.

Returns: type CLASS_NODESET

getTypeString

public String getTypeString()
Given a request type, return the equivalent string. For diagnostic purposes.

Returns: type string "#NODESET"

greaterThan

public boolean greaterThan(XObject obj2)
Tell if one object is less than the other.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

greaterThanOrEqual

public boolean greaterThanOrEqual(XObject obj2)
Tell if one object is less than the other.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

iter

public DTMIterator iter()
Cast result object to a nodelist.

Returns: The nodeset as a nodelist

iterRaw

public DTMIterator iterRaw()
Return the iterator without cloning, etc.

lessThan

public boolean lessThan(XObject obj2)
Tell if one object is less than the other.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

lessThanOrEqual

public boolean lessThanOrEqual(XObject obj2)
Tell if one object is less than or equal to the other.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

mutableNodeset

public NodeSetDTM mutableNodeset()
Cast result object to a mutableNodeset.

Returns: The nodeset as a mutableNodeset

nodelist

public NodeList nodelist()
Cast result object to a nodelist.

Returns: a NodeList.

Throws: javax.xml.transform.TransformerException

nodeset

public NodeIterator nodeset()
Cast result object to a nodelist.

Returns: a NodeIterator.

Throws: javax.xml.transform.TransformerException

notEquals

public boolean notEquals(XObject obj2)
Tell if two objects are functionally not equal.

Parameters: obj2 object to compare this nodeset to

Returns: see this.compare(...)

Throws: javax.xml.transform.TransformerException

num

public double num()
Cast result object to a number.

Returns: numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found

numWithSideEffects

public double numWithSideEffects()
Cast result object to a number, but allow side effects, such as the incrementing of an iterator.

Returns: numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found

object

public Object object()
Return a java object that's closest to the representation that should be handed to an extension.

Returns: The object that this class wraps

release

public void release(DTMIterator iter)

str

public String str()
Cast result object to a string.

Returns: the string conversion from the next node in the nodeset or "" if there is no next node

xstr

public XMLString xstr()
Cast result object to an XMLString.

Returns: The document fragment node data or the empty string.

Copyright B) 2006 Apache XML Project. All Rights Reserved.