org.jvoicexml.xml
Class XmlNodeList<T extends XmlNode>

java.lang.Object
  extended by org.jvoicexml.xml.XmlNodeList<T>
Type Parameters:
T - Type of the nodes in the list.
All Implemented Interfaces:
NodeList

public final class XmlNodeList<T extends XmlNode>
extends Object
implements NodeList

A list containing all XmlNodes of a parent node.

This wrapper class is needed to ensure that all child nodes that are accessed via the Node.getChildNodes method are of the requested type.

Version:
$Revision: 197 $

Copyright © 2006-2007 JVoiceXML group - http://jvoicexml.sourceforge.net/

Author:
Dirk Schnelle
See Also:
XmlNode

Constructor Summary
XmlNodeList()
          Constructs a new object.
XmlNodeList(XmlNodeFactory<T> factory, NodeList nodeList)
          Construct a new node list.
 
Method Summary
 boolean add(T node)
          Appends the specified element to the end of this list.
 int getLength()
          
 Node item(int index)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlNodeList

public XmlNodeList()
Constructs a new object.


XmlNodeList

public XmlNodeList(XmlNodeFactory<T> factory,
                   NodeList nodeList)
Construct a new node list.

Parameters:
factory - The factory to resolve real T's.
nodeList - The nodelist to encapsulate.
Method Detail

getLength

public int getLength()

Specified by:
getLength in interface NodeList

item

public Node item(int index)

Specified by:
item in interface NodeList

add

public boolean add(T node)
Appends the specified element to the end of this list.

Note: This has no effect on the document.

Parameters:
node - XmlNode to be appended to this list.
Returns:
true (as per the general contract of the Collection.add method).


Copyright © 2005-2007 JVoiceXML group.