APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.org.apache.xml.internal.dtm.ref

public Class DTMNodeList

extends DTMNodeListBase
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.DTM, .DTMIterator, org.w3c.dom.Node

DTMNodeList gives us an implementation of the DOM's NodeList interface wrapped around a DTM Iterator. The author considers this something of an abominations, since NodeList was not intended to be a general purpose "list of nodes" API and is generally considered by the DOM WG to have be a mistake... but I'm told that some of the XPath/XSLT folks say they must have this solution. Please note that this is not necessarily equivlaent to a DOM NodeList operating over the same document. In particular:

State: In progress!!

Field Summary

Modifier and TypeField and Description
private DTMIterator

Constructor Summary

AccessConstructor and Description
private
public
DTMNodeList(DTMIterator dtmIterator)

Public constructor: Wrap a DTMNodeList around an existing and preconfigured DTMIterator

Warning

THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true) AGAINST THE DTMIterator.

Method Summary

Modifier and TypeMethod and Description
public DTMIterator
getDTMIterator()

Access the wrapped DTMIterator.

public int
public Node

Returns:

The node at the indexth position in the NodeList, or null if that is not a valid index.
item
(int
Index into the collection.
index
)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMNodeListBase.item.

Implements org.w3c.dom.NodeList.item.

Returns the indexth item in the collection.

Field Detail

m_iterback to summary
private DTMIterator m_iter

Constructor Detail

DTMNodeListback to summary
private DTMNodeList()
DTMNodeListback to summary
public DTMNodeList(DTMIterator dtmIterator)

Public constructor: Wrap a DTMNodeList around an existing and preconfigured DTMIterator

Warning

THIS HAS THE SIDE EFFECT OF ISSUING setShouldCacheNodes(true) AGAINST THE DTMIterator.

Method Detail

getDTMIteratorback to summary
public DTMIterator getDTMIterator()

Access the wrapped DTMIterator. I'm not sure whether anyone will need this or not, but let's write it and think about it.

getLengthback to summary
public int getLength()

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMNodeListBase.getLength.

Implements org.w3c.dom.NodeList.getLength.

The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.

itemback to summary
public Node item(int index)

Overrides com.sun.org.apache.xml.internal.dtm.ref.DTMNodeListBase.item.

Implements org.w3c.dom.NodeList.item.

Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.

Parameters
index:int

Index into the collection.

Returns:Node

The node at the indexth position in the NodeList, or null if that is not a valid index.