org.apache.commons.collections4.iterators

## 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
  Version:
    $Id: NodeListIterator.java 1686855 2015-06-22 13:00:27Z tn $
  See Also:
    `NodeList`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `NodeListIterator(Node node)` Convenience constructor, which creates a new NodeListIterator from the specified node's childNodes.
    `NodeListIterator(NodeList nodeList)` Constructor, that creates a new NodeListIterator from the specified `org.w3c.NodeList`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()`
    `Node` | `next()`
    `void` | `remove()` Throws `UnsupportedOperationException`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### 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 Detail

    - #### hasNext

          public boolean hasNext()

      Specified by:
        `hasNext` in interface `Iterator<Node>`

    - #### next

          public Node next()

      Specified by:
        `next` in interface `Iterator<Node>`

    - #### remove

          public void remove()

      Throws `UnsupportedOperationException`.
      Specified by:
        `remove` in interface `Iterator<Node>`
      Throws:
        `UnsupportedOperationException` - always

Copyright © 2001–2015 The Apache Software Foundation. All rights reserved.