Package net.sf.saxon.om

## Class IteratorWrapper

- java.lang.Object
- - net.sf.saxon.om.IteratorWrapper

- All Implemented Interfaces:
    `java.io.Closeable`, `java.lang.AutoCloseable`, `SequenceIterator`

      public class IteratorWrapper
      extends java.lang.Object
      implements SequenceIterator

  Class IteratorWrapper - provides an an SequenceIterator over a Java Iterator.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.sf.saxon.om.SequenceIterator

      `SequenceIterator.Property`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `IteratorWrapper​(java.util.Iterator<? extends Item> iterator)` | Create a IteratorWrapper backed by an iterator

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Item` | `next()` | Get the next item in the Iterator

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

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

    - ### Methods inherited from interface net.sf.saxon.om.SequenceIterator

      `close, forEachOrFail, getProperties, materialize`

- - ### Constructor Detail

    - #### IteratorWrapper

          public IteratorWrapper​(java.util.Iterator<? extends Item> iterator)

      Create a IteratorWrapper backed by an iterator
      Parameters:
        `iterator` - the iterator that delivers the items in the sequence

  - ### Method Detail

    - #### next

          public Item next()
                    throws XPathException

      Get the next item in the Iterator
      Specified by:
        `next` in interface `SequenceIterator`
      Returns:
        the next item in the iterator, or null if there are no more items. Once a call on next() has returned null, no further calls should be made.
      Throws:
        `XPathException` - if an error occurs retrieving the next item