Interface CloseableIteration<E>

All Superinterfaces:
AutoCloseable, Iterator<E>
All Known Subinterfaces:
GraphQueryResult, QueryResult<T>, TupleQueryResult
All Known Implementing Classes:
AbstractCloseableIteration, AbstractCloseableIteratorIteration, AsyncIteratorBuffer, AsyncIteratorDirect, AsyncIteratorReadAhead, BackgroundGraphResult, BackgroundTupleResult, BadlyDesignedLeftJoinIterator, BoundJoinConversionIteration, BoundJoinVALUESConversionIteration, CachedGraphQueryResult, CachedTupleQueryResult, CleanerGraphQueryResult, CleanerTupleQueryResult, CloseableIteratorIteration, CloseablePeakableIteration, CloseDependentConnectionIteration, CollectionIteration, ConsumingIteration, ControlledWorkerBoundJoin, ControlledWorkerJoin, ControlledWorkerLeftJoin, ControlledWorkerUnion, ConvertingIteration, CrossProductIteration, DelayedIteration, DescribeIteration, DistinctIteration, DistinctModelReducingUnionIteration, DualUnionIteration, EmptyIteration, ExceptionConvertingIteration, ExtensionIterator, FederatedDescribeIteration, FedXPathIteration, FedXQueueCursor, FedXZeroLengthPathIteration, FilteringInsertBindingsIteration, FilteringIteration, FilteringIteration, FilterIteration, FilterIterator, GraphToBindingSetConversionIteration, GroupedCheckConversionIteration, GroupIterator, HashJoin, HashJoinIteration, IndependentJoingroupBindingsIteration, IndependentJoingroupBindingsIteration2, IndependentJoingroupBindingsIteration3, InnerMergeJoinIterator, InsertBindingSetCursor, InsertBindingsIteration, IntersectIteration, IteratingGraphQueryResult, IteratingTupleQueryResult, IterationWrapper, JoinExecutorBase, JoinExecutorBase, JoinIterator, LazyMutableClosableIteration, LeftJoinIterator, LimitIteration, LockingIteration, LoggingCloseableIteration, LookAheadIteration, MemStatementIterator, MemTripleIterator, MinusIteration, MultiProjectionIterator, MutableTupleQueryResult, OffsetIteration, OrderIterator, ParallelExecutorBase, ParallelServiceExecutor, PathIteration, PeekMarkIterator, PrintingIteration, ProjectionIterator, QueryContextIteration, QueryEvaluationStep.DelayedEvaluationIteration, QueryResultIteration, QueueCursor, QueueIteration, ReducedIteration, RepositoryResult, ReusableGraphQueryResult, ReusableTupleQueryResult, ServiceJoinConversionIteration, ServiceJoinIterator, SilentIteration, SingleBindingSetIteration, SingletonIteration, SortedIteration, SPARQLCrossProductIteration, SPARQLMinusIteration, StatementConversionIteration, StopRemainingExecutionsOnCloseIteration, SynchronousBoundJoin, SynchronousJoin, SynchronousWorkerUnion, ThreadSafeDelayedIteration, TimeLimitIteration, TripleSourceIterationWrapper, UnionExecutorBase, UnionIteration, WorkerUnionBase, ZeroLengthPathIteration

public interface CloseableIteration<E> extends Iterator<E>, AutoCloseable
An CloseableIteration that can be closed to free resources that it is holding. CloseableIterations automatically free their resources when exhausted. If not read until exhaustion or if you want to make sure the iteration is properly closed, any code using the iterator should be placed in a try-with-resources block, closing the iteration automatically, e.g.:

 try (CloseableIteration<Object, Exception> iter = ...) {
    // read objects from the iterator
 }
 catch(Exception e) {
   // process the exception that can be thrown while processing.
 }