Class AbstractCloseableIteration<E,X extends Exception>

java.lang.Object
org.eclipse.rdf4j.common.iteration.AbstractCloseableIteration<E,X>
All Implemented Interfaces:
AutoCloseable, CloseableIteration<E,X>, Iteration<E,X>
Direct Known Subclasses:
CloseableIteratorIteration, CollectionIteration, ConstructTupleFunction.GraphQueryResultIteration, ConvertingIteration, DelayedEvaluationIteration, DelayedIteration, EmptyIteration, ExceptionConvertingIteration, IterationWrapper, LookAheadIteration, QueryContextIteration, QueryResults.GraphQueryResultFilter, QueryResults.TupleQueryResultFilter, RepositoryResult, SelectTupleFunction.TupleQueryResultIteration, SingletonIteration

@Deprecated(since="4.1.0") public abstract class AbstractCloseableIteration<E,X extends Exception> extends Object implements CloseableIteration<E,X>
Deprecated.
Base class for CloseableIterations offering common functionality. This class keeps track of whether the iteration has been closed and handles multiple calls to close() by ignoring all but the first call.

Instances of this class is not safe to be accessed from multiple threads at the same time.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private boolean
    Deprecated.
    Flag indicating whether this iteration has been closed.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    Deprecated.
    Calls handleClose() upon first call and makes sure the resource closures are only executed once.
    protected void
    Deprecated.
    Called by close() when it is called for the first time.
    final boolean
    Deprecated.
    Checks whether this CloseableIteration has been closed.

    Methods inherited from class java.lang.Object

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

    Methods inherited from interface org.eclipse.rdf4j.common.iteration.CloseableIteration

    stream

    Methods inherited from interface org.eclipse.rdf4j.common.iteration.Iteration

    hasNext, next, remove
  • Field Details

    • closed

      private boolean closed
      Deprecated.
      Flag indicating whether this iteration has been closed.
  • Constructor Details

    • AbstractCloseableIteration

      public AbstractCloseableIteration()
      Deprecated.
  • Method Details

    • isClosed

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

      public final void close() throws X
      Deprecated.
      Calls handleClose() upon first call and makes sure the resource closures are only executed once.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface CloseableIteration<E,X extends Exception>
      Throws:
      X
    • handleClose

      protected void handleClose() throws X
      Deprecated.
      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:
      X