Top Description Fields Constructors Methods
com.sun.org.apache.xpath.internal.objects

public Class XNodeSet

Additional top-level classes in compilation unit: Comparator, LessThanComparator, LessThanOrEqualComparator, GreaterThanComparator, GreaterThanOrEqualComparator, EqualComparator, NotEqualComparator.

extends NodeSequence
Class Inheritance
Known Direct Subclasses
com.sun.org.apache.xpath.internal.objects.XNodeSetForDOM, com.sun.org.apache.xpath.internal.objects.XNull
Imports
com.sun.org.apache.xml.internal.dtm.DTM, .DTMIterator, .DTMManager, com.sun.org.apache.xml.internal.utils.XMLString, com.sun.org.apache.xpath.internal.NodeSetDTM, com.sun.org.apache.xpath.internal.axes.NodeSequence, java.util.ArrayList, .List, org.w3c.dom.NodeList, org.w3c.dom.traversal.NodeIterator

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

Field Summary

Modifier and TypeField and Description
pack-priv static final EqualComparator
S_EQ

Equal comparator

pack-priv static final GreaterThanComparator
S_GT

Greater than comparator

pack-priv static final GreaterThanOrEqualComparator
S_GTE

Greater than or equal comparator

pack-priv static final LessThanComparator
S_LT

Less than comparator

pack-priv static final LessThanOrEqualComparator
S_LTE

Less than or equal comparator

pack-priv static final NotEqualComparator
S_NEQ

Not equal comparator

pack-priv static final long
Inherited from com.sun.org.apache.xpath.internal.axes.NodeSequence:
m_dtmMgrm_iterm_lastm_next

Constructor Summary

AccessConstructor and Description
protected
XNodeSet()

Default constructor for derived objects.

public
XNodeSet(DTMIterator
Value of the XNodeSet object
val
)

Construct a XNodeSet object.

public
XNodeSet(XNodeSet
Value of the XNodeSet object
val
)

Construct a XNodeSet object.

public
XNodeSet(DTMManager dtmMgr)

Construct an empty XNodeSet object.

public
XNodeSet(int
Node to add to the new XNodeSet object
n
,
DTMManager dtmMgr)

Construct a XNodeSet object for one node.

Method Summary

Modifier and TypeMethod and Description
public void

Returns:

The string this wraps or the empty string if null
appendToFsb
(FastStringBuffer fsb)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.appendToFsb.

Cast result object to a string.

public boolean

Returns:

True if there is a next node in the nodeset
bool
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.bool.

Cast result object to a boolean.

public boolean

Returns:

True if there is a next node in the nodeset
boolWithSideEffects
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.boolWithSideEffects.

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

public boolean

Returns:

See the comments below for each object type comparison
compare
(XObject
Object to compare this nodeset to
obj2
,
Comparator
Comparator to use
comparator
)

Tell if one object is less than the other.

public void
dispatchCharactersEvents(ContentHandler
A non-null reference to a ContentHandler.
ch
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.dispatchCharactersEvents.

Directly call the characters method on the passed ContentHandler for the string-value.

public boolean

Returns:

see this.compare(...)
equals
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.equals.

Tell if two objects are functionally equal.

public XObject

Returns:

A fresh nodelist.
getFresh
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getFresh.

Get a fresh copy of the object.

public double

Returns:

numeric value of the string conversion from a single node.
getNumberFromNode
(int
Node to convert
n
)

Get numeric value of the string conversion from a single node.

public XMLString

Returns:

the string conversion from a single node.
getStringFromNode
(int
Node to convert
n
)

Get the string conversion from a single node.

public int

Returns:

type CLASS_NODESET
getType
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getType.

Tell that this is a CLASS_NODESET.

public String

Returns:

type string "#NODESET"
getTypeString
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getTypeString.

Given a request type, return the equivalent string.

public boolean

Returns:

see this.compare(...)
greaterThan
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.greaterThan.

Tell if one object is less than the other.

public boolean

Returns:

see this.compare(...)
greaterThanOrEqual
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.greaterThanOrEqual.

Tell if one object is less than the other.

public DTMIterator

Returns:

The nodeset as a nodelist
iter
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.iter.

Cast result object to a nodelist.

public DTMIterator
iterRaw()

Return the iterator without cloning, etc.

public boolean

Returns:

see this.compare(...)
lessThan
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.lessThan.

Tell if one object is less than the other.

public boolean

Returns:

see this.compare(...)
lessThanOrEqual
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.lessThanOrEqual.

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

public NodeSetDTM

Returns:

The nodeset as a mutableNodeset
mutableNodeset
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.mutableNodeset.

Cast result object to a mutableNodeset.

public NodeList

Returns:

a NodeList.
nodelist
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.nodelist.

Cast result object to a nodelist.

public NodeIterator

Returns:

a NodeIterator.
nodeset
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.nodeset.

Cast result object to a nodelist.

public boolean

Returns:

see this.compare(...)
notEquals
(XObject
object to compare this nodeset to
obj2
)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.notEquals.

Tell if two objects are functionally not equal.

public double

Returns:

numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found
num
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.num.

Cast result object to a number.

public double

Returns:

numeric value of the string conversion from the next node in the NodeSetDTM, or NAN if no node was found
numWithSideEffects
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.numWithSideEffects.

Cast result object to a number, but allow side effects, such as the incrementing of an iterator.

public Object

Returns:

The object that this class wraps
object
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.object.

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

public void
public String

Returns:

the string conversion from the next node in the nodeset or "" if there is no next node
str
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.str.

Cast result object to a string.

public XMLString

Returns:

The document fragment node data or the empty string.
xstr
()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.xstr.

Cast result object to an XMLString.

Inherited from com.sun.org.apache.xpath.internal.axes.NodeSequence:
addNodeInDocOrderallowDetachToReleaseclonecloneWithResetdetachfixupVariablesgetAnalysisBitsgetAxisgetContainedItergetCurrentNodegetCurrentPosgetDTMgetDTMManagergetExpandEntityReferencesgetIteratorCachegetLengthgetRootgetVectorgetWhatToShowhasCacheisDocOrderedisFreshisMutableitemnextNodepreviousNoderesetrunTosetCurrentPossetItemsetItersetObjectsetRootsetShouldCacheNodesSetVector

Field Detail

S_EQback to summary
pack-priv static final EqualComparator S_EQ

Equal comparator

S_GTback to summary
pack-priv static final GreaterThanComparator S_GT

Greater than comparator

S_GTEback to summary
pack-priv static final GreaterThanOrEqualComparator S_GTE

Greater than or equal comparator

S_LTback to summary
pack-priv static final LessThanComparator S_LT

Less than comparator

S_LTEback to summary
pack-priv static final LessThanOrEqualComparator S_LTE

Less than or equal comparator

S_NEQback to summary
pack-priv static final NotEqualComparator S_NEQ

Not equal comparator

serialVersionUIDback to summary
pack-priv static final long serialVersionUID

Hides com.sun.org.apache.xpath.internal.axes.NodeSequence.serialVersionUID.

Constructor Detail

XNodeSetback to summary
protected XNodeSet()

Default constructor for derived objects.

XNodeSetback to summary
public XNodeSet(DTMIterator val)

Construct a XNodeSet object.

Parameters
val:DTMIterator

Value of the XNodeSet object

XNodeSetback to summary
public XNodeSet(XNodeSet val)

Construct a XNodeSet object.

Parameters
val:XNodeSet

Value of the XNodeSet object

XNodeSetback to summary
public XNodeSet(DTMManager dtmMgr)

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

XNodeSetback to summary
public XNodeSet(int n, DTMManager dtmMgr)

Construct a XNodeSet object for one node.

Parameters
n:int

Node to add to the new XNodeSet object

Method Detail

appendToFsbback to summary
public void appendToFsb(FastStringBuffer fsb)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.appendToFsb.

Cast result object to a string.

Returns:void

The string this wraps or the empty string if null

boolback to summary
public boolean bool()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.bool.

Cast result object to a boolean.

Returns:boolean

True if there is a next node in the nodeset

boolWithSideEffectsback to summary
public boolean boolWithSideEffects()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.boolWithSideEffects.

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

Returns:boolean

True if there is a next node in the nodeset

compareback to summary
public boolean compare(XObject obj2, Comparator comparator) throws TransformerException

Tell if one object is less than the other.

Parameters
obj2:XObject

Object to compare this nodeset to

comparator:Comparator

Comparator to use

Returns:boolean

See the comments below for each object type comparison

dispatchCharactersEventsback to summary
public void dispatchCharactersEvents(ContentHandler ch) throws SAXException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.dispatchCharactersEvents.

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:ContentHandler

A non-null reference to a ContentHandler.

equalsback to summary
public boolean equals(XObject obj2)

Overrides com.sun.org.apache.xpath.internal.objects.XObject.equals.

Tell if two objects are functionally equal.

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

getFreshback to summary
public XObject getFresh()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getFresh.

Get a fresh copy of the object. For use with variables.

Returns:XObject

A fresh nodelist.

getNumberFromNodeback to summary
public double getNumberFromNode(int n)

Get numeric value of the string conversion from a single node.

Parameters
n:int

Node to convert

Returns:double

numeric value of the string conversion from a single node.

getStringFromNodeback to summary
public XMLString getStringFromNode(int n)

Get the string conversion from a single node.

Parameters
n:int

Node to convert

Returns:XMLString

the string conversion from a single node.

getTypeback to summary
public int getType()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getType.

Tell that this is a CLASS_NODESET.

Returns:int

type CLASS_NODESET

getTypeStringback to summary
public String getTypeString()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.getTypeString.

Given a request type, return the equivalent string. For diagnostic purposes.

Returns:String

type string "#NODESET"

greaterThanback to summary
public boolean greaterThan(XObject obj2) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.greaterThan.

Tell if one object is less than the other.

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

greaterThanOrEqualback to summary
public boolean greaterThanOrEqual(XObject obj2) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.greaterThanOrEqual.

Tell if one object is less than the other.

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

iterback to summary
public DTMIterator iter()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.iter.

Cast result object to a nodelist.

Returns:DTMIterator

The nodeset as a nodelist

iterRawback to summary
public DTMIterator iterRaw()

Return the iterator without cloning, etc.

lessThanback to summary
public boolean lessThan(XObject obj2) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.lessThan.

Tell if one object is less than the other.

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

lessThanOrEqualback to summary
public boolean lessThanOrEqual(XObject obj2) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.lessThanOrEqual.

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

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

mutableNodesetback to summary
public NodeSetDTM mutableNodeset()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.mutableNodeset.

Cast result object to a mutableNodeset.

Returns:NodeSetDTM

The nodeset as a mutableNodeset

nodelistback to summary
public NodeList nodelist() throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.nodelist.

Cast result object to a nodelist.

Returns:NodeList

a NodeList.

nodesetback to summary
public NodeIterator nodeset() throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.nodeset.

Cast result object to a nodelist.

Returns:NodeIterator

a NodeIterator.

notEqualsback to summary
public boolean notEquals(XObject obj2) throws TransformerException

Overrides com.sun.org.apache.xpath.internal.objects.XObject.notEquals.

Tell if two objects are functionally not equal.

Parameters
obj2:XObject

object to compare this nodeset to

Returns:boolean

see this.compare(...)

numback to summary
public double num()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.num.

Cast result object to a number.

Returns:double

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

numWithSideEffectsback to summary
public double numWithSideEffects()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.numWithSideEffects.

Cast result object to a number, but allow side effects, such as the incrementing of an iterator.

Returns:double

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

objectback to summary
public Object object()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.object.

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

Returns:Object

The object that this class wraps

releaseback to summary
public void release(DTMIterator iter)
strback to summary
public String str()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.str.

Cast result object to a string.

Returns:String

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

xstrback to summary
public XMLString xstr()

Overrides com.sun.org.apache.xpath.internal.objects.XObject.xstr.

Cast result object to an XMLString.

Returns:XMLString

The document fragment node data or the empty string.