Class NodeListIterator
- java.lang.Object
-
- org.apache.commons.collections4.iterators.NodeListIterator
-
- All Implemented Interfaces:
java.util.Iterator<org.w3c.dom.Node>
public class NodeListIterator extends java.lang.Object implements java.util.Iterator<org.w3c.dom.Node>
AnIterator
over aNodeList
.This iterator does not support
remove()
as aNodeList
does not support removal of items.- Since:
- 4.0
- See Also:
NodeList
-
-
Constructor Summary
Constructors Constructor 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 specifiedorg.w3c.NodeList
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
org.w3c.dom.Node
next()
void
remove()
ThrowsUnsupportedOperationException
.
-
-
-
Constructor Detail
-
NodeListIterator
public NodeListIterator(org.w3c.dom.Node node)
Convenience constructor, which creates a new NodeListIterator from the specified node's childNodes.- Parameters:
node
- Node, who's child nodes are wrapped by this class. Must not be null- Throws:
java.lang.NullPointerException
- if node is null
-
NodeListIterator
public NodeListIterator(org.w3c.dom.NodeList nodeList)
Constructor, that creates a new NodeListIterator from the specifiedorg.w3c.NodeList
- Parameters:
nodeList
- node list, which is wrapped by this class. Must not be null- Throws:
java.lang.NullPointerException
- if nodeList is null
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfacejava.util.Iterator<org.w3c.dom.Node>
-
next
public org.w3c.dom.Node next()
- Specified by:
next
in interfacejava.util.Iterator<org.w3c.dom.Node>
-
remove
public void remove()
ThrowsUnsupportedOperationException
.- Specified by:
remove
in interfacejava.util.Iterator<org.w3c.dom.Node>
- Throws:
java.lang.UnsupportedOperationException
- always
-
-