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

public Class DTMChildIterNodeList

extends DTMNodeListBase
Class Inheritance
Imports
com.sun.org.apache.xml.internal.dtm.DTM, 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 int
private DTM

Constructor Summary

AccessConstructor and Description
private
public
DTMChildIterNodeList(DTM
The DTM containing this node
parentDTM
,
int
DTM node-handle integer
parentHandle
)

Public constructor: Create a NodeList to support DTMNodeProxy.getChildren().

Method Summary

Modifier and TypeMethod and Description
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_firstChildback to summary
private int m_firstChild
m_parentDTMback to summary
private DTM m_parentDTM

Constructor Detail

DTMChildIterNodeListback to summary
private DTMChildIterNodeList()
DTMChildIterNodeListback to summary
public DTMChildIterNodeList(DTM parentDTM, int parentHandle)

Public constructor: Create a NodeList to support DTMNodeProxy.getChildren(). Unfortunately AxisIterators and DTMIterators don't share an API, so I can't use the existing Axis.CHILD iterator. Rather than create Yet Another Class, let's set up a special case of this one.

Parameters
parentDTM:DTM

The DTM containing this node

parentHandle:int

DTM node-handle integer

Method Detail

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.