|
Groovy Documentation | |||||||
| FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.jdesktop.dom.SimpleNodeList
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.
| 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 |
|---|
private org.w3c.dom.NodeList list
| Constructor Detail |
|---|
public SimpleNodeList(org.w3c.dom.NodeList list)
list - the NodeList to wrap.
public SimpleNodeList(List nodes)
nodes - the nodes to wrap
public SimpleNodeList(org.w3c.dom.Node... nodes)
nodes - the nodes to wrap
| Method Detail |
|---|
public int getLength()
public org.w3c.dom.Node item(int index)
public Iterator iterator()
Groovy Documentation