org.ozoneDB.xml.dom
Class NodeListImpl

java.lang.Object
  |
  +--org.ozoneDB.xml.dom.NodeListImpl
All Implemented Interfaces:
org.w3c.dom.NodeList, java.io.Serializable

public final class NodeListImpl
extends java.lang.Object
implements org.w3c.dom.NodeList, java.io.Serializable

Used to traverse childs of a node. NodeList is a live list, meaning that any change to the node is reflected in this list and vice versa.

The functionality of NodeList is implemented in NodeImpl itself using a double-linked list. This class is only provided to hide the interface of NodeImpl.

This class is not entirely thread-safe due to thread-safe limitations on NodeImpl itself.

Version:
$Revision: 1.1 $ $Date: 2001/12/18 11:03:24 $
Author:
Assaf Arkin
See Also:
NodeImpl, Serialized Form

Field Summary
protected  java.util.Vector _nodes
           
protected  org.w3c.dom.Node _rootNode
          The node which this list traverses.
 
Constructor Summary
NodeListImpl(org.w3c.dom.Node node)
          Constructor requires node.
 
Method Summary
 int getLength()
          Return the number of childs in this node.
 org.w3c.dom.Node item(int index)
          Return the nth child in the node (zero based).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_rootNode

protected org.w3c.dom.Node _rootNode
The node which this list traverses.


_nodes

protected java.util.Vector _nodes
Constructor Detail

NodeListImpl

public NodeListImpl(org.w3c.dom.Node node)
Constructor requires node.

Parameters:
node - Node to traverse
Method Detail

item

public org.w3c.dom.Node item(int index)
Return the nth child in the node (zero based). If the child does not exist, returns null. No exception is thrown if index is negative.

Specified by:
item in interface org.w3c.dom.NodeList
Parameters:
index - Index of child to return (zero based)
Returns:
Child or null
See Also:
NodeImpl.getChild(int)

getLength

public int getLength()
Return the number of childs in this node.

Specified by:
getLength in interface org.w3c.dom.NodeList
Returns:
Number of childs


Copyright © 2002 The Ozone Database Project - www.ozone-db.org. All Rights Reserved.