Class AbstractCloseableIterator<E>

java.lang.Object
org.eclipse.rdf4j.common.iterator.AbstractCloseableIterator<E>
All Implemented Interfaces:
Closeable, AutoCloseable, Iterator<E>
Direct Known Subclasses:
LookAheadIterator

public abstract class AbstractCloseableIterator<E> extends Object implements Iterator<E>, Closeable
Author:
MJAHale
  • Constructor Details Link icon

    • AbstractCloseableIterator Link icon

      public AbstractCloseableIterator()
  • Method Details Link icon

    • isClosed Link icon

      public final boolean isClosed()
      Checks whether this Iterator has been closed.
      Returns:
      true if the Iterator has been closed, false otherwise.
    • close Link icon

      public final void close() throws IOException
      Calls handleClose() upon first call and makes sure this method gets called only once.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException
    • handleClose Link icon

      protected void handleClose() throws IOException
      Called by close() when it is called for the first time. This method is only called once on each iteration. By default, this method does nothing.
      Throws:
      IOException
    • handleAlreadyClosed Link icon

      protected void handleAlreadyClosed() throws IOException
      Throws:
      IOException