org.eclipse.rdf4j.common.iterator

## Class LookAheadIterator<E>

- java.lang.Object
- - org.eclipse.rdf4j.common.iterator.AbstractCloseableIterator<E>
  - - org.eclipse.rdf4j.common.iterator.LookAheadIterator<E>

- All Implemented Interfaces:
    Closeable, AutoCloseable, Iterator<E>
  Direct Known Subclasses:
    UnionIterator

      public abstract class LookAheadIterator<E>
      extends AbstractCloseableIterator<E>

  Author:
    MJAHale

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `LookAheadIterator()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected abstract E` | `getNextElement()` Gets the next element.
    `protected void` | `handleAlreadyClosed()`
    `protected void` | `handleClose()` Called by `AbstractCloseableIterator.close()` when it is called for the first time.
    `boolean` | `hasNext()`
    `E` | `next()`
    `void` | `remove()` Throws an `UnsupportedOperationException`.

    - ### Methods inherited from class org.eclipse.rdf4j.common.iterator.AbstractCloseableIterator

      `close, isClosed`

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

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

    - ### Methods inherited from interface java.util.Iterator

      `forEachRemaining`

- - ### Constructor Detail

    - #### LookAheadIterator

          protected LookAheadIterator()

  - ### Method Detail

    - #### getNextElement

          protected abstract E getNextElement()

      Gets the next element. Subclasses should implement this method so that it returns the next element.
      Returns:
        The next element, or `null` if no more elements are available.

    - #### hasNext

          public final boolean hasNext()

    - #### next

          public final E next()

    - #### remove

          public void remove()

      Throws an `UnsupportedOperationException`.

    - #### handleClose

          protected void handleClose()
                              throws IOException

      Description copied from class: `AbstractCloseableIterator`
      Called by `AbstractCloseableIterator.close()` when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing.
      Overrides:
        `handleClose` in class `AbstractCloseableIterator<E>`
      Throws:
        `IOException`

    - #### handleAlreadyClosed

          protected void handleAlreadyClosed()
                                      throws IOException

      Overrides:
        `handleAlreadyClosed` in class `AbstractCloseableIterator<E>`
      Throws:
        `IOException`

Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.