Class NodeListIterator

java.lang.Object
org.apache.commons.collections4.iterators.NodeListIterator
All Implemented Interfaces:
Iterator<Node>

public class NodeListIterator extends Object implements Iterator<Node>
An Iterator over a NodeList.

This iterator does not support remove() as a NodeList does not support removal of items.

Since:
4.0
See Also:
  • Field Details

    • nodeList

      private final NodeList nodeList
      the original NodeList instance
    • index

      private int index
      The current iterator index
  • Constructor Details

    • NodeListIterator

      public NodeListIterator(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:
      NullPointerException - if node is null
    • NodeListIterator

      public NodeListIterator(NodeList nodeList)
      Constructor, that creates a new NodeListIterator from the specified org.w3c.NodeList
      Parameters:
      nodeList - node list, which is wrapped by this class. Must not be null
      Throws:
      NullPointerException - if nodeList is null
  • Method Details