Groovy Documentation

org.jdesktop.dom
[Java] Class SimpleNodeList

java.lang.Object
  org.jdesktop.dom.SimpleNodeList
All Implemented Interfaces:
org.w3c.dom.NodeList, Iterable

public class SimpleNodeList
extends Object

An implementation of org.w3c.dom.NodeList which also implements Iterable. This allows you to use a SimpleNodeList in an enhanced for loop, such as:


  SimpleNodeList nodes = ...;
  for (Node n : nodes) {
      System.out.println(n.getTextContent());
  }
 

SimpleNodeList wraps a source NodeList. Thus, any NodeList can be adapted for use with enhanced for loops by wrapping it in a SimpleNodeList.

Authors:
rbair


Field Summary
private org.w3c.dom.NodeList list

 
Constructor Summary
SimpleNodeList(org.w3c.dom.NodeList list)

Creates a new instance of SimpleNodeList.

SimpleNodeList(List nodes)

Create a new SimpleNodeList that wraps the given nodes

SimpleNodeList(org.w3c.dom.Node... nodes)

Create a new SimpleNodeList that wraps the given nodes

 
Method Summary
int getLength()

@inheritDoc

org.w3c.dom.Node item(int index)

@inheritDoc

Iterator iterator()

@inheritDoc

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

list

private org.w3c.dom.NodeList list


 
Constructor Detail

SimpleNodeList

public SimpleNodeList(org.w3c.dom.NodeList list)
Creates a new instance of SimpleNodeList.
Parameters:
list - the NodeList to wrap.


SimpleNodeList

public SimpleNodeList(List nodes)
Create a new SimpleNodeList that wraps the given nodes
Parameters:
nodes - the nodes to wrap


SimpleNodeList

public SimpleNodeList(org.w3c.dom.Node... nodes)
Create a new SimpleNodeList that wraps the given nodes
Parameters:
nodes - the nodes to wrap


 
Method Detail

getLength

public int getLength()
inheritDoc:


item

public org.w3c.dom.Node item(int index)
inheritDoc:


iterator

public Iterator iterator()
inheritDoc:


 

Groovy Documentation