public class NodeListIterator
extends java.lang.Object
implements java.util.Iterator<org.w3c.dom.Node>
Iterator over a NodeList.
This iterator does not support remove() as a NodeList does not support
removal of items.
NodeList| Modifier and Type | Field and Description |
|---|---|
private int |
index
The current iterator index
|
private org.w3c.dom.NodeList |
nodeList
the original NodeList instance
|
| Constructor and Description |
|---|
NodeListIterator(org.w3c.dom.Node node)
Convenience constructor, which creates a new NodeListIterator from
the specified node's childNodes.
|
NodeListIterator(org.w3c.dom.NodeList nodeList)
Constructor, that creates a new NodeListIterator from the specified
org.w3c.NodeList |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
org.w3c.dom.Node |
next() |
void |
remove()
Throws
UnsupportedOperationException. |
private final org.w3c.dom.NodeList nodeList
private int index
public NodeListIterator(org.w3c.dom.Node node)
node - Node, who's child nodes are wrapped by this class. Must not be nulljava.lang.IllegalArgumentException - if node is nullpublic NodeListIterator(org.w3c.dom.NodeList nodeList)
org.w3c.NodeListnodeList - node list, which is wrapped by this class. Must not be nulljava.lang.IllegalArgumentException - if nodeList is nullpublic boolean hasNext()
hasNext in interface java.util.Iterator<org.w3c.dom.Node>public org.w3c.dom.Node next()
next in interface java.util.Iterator<org.w3c.dom.Node>public void remove()
UnsupportedOperationException.remove in interface java.util.Iterator<org.w3c.dom.Node>java.lang.UnsupportedOperationException - always