Package org.apache.jena.util.iterator
Interface ClosableIterator<T>
-
- All Superinterfaces:
Closeable
,java.util.Iterator<T>
,IteratorCloseable<T>
- All Known Subinterfaces:
ExtendedIterator<T>
,NodeIterator
,NsIterator
,ResIterator
,RSIterator
,StmtIterator
,TripleIterator
- All Known Implementing Classes:
ContNodeIteratorImpl
,FilterIterator
,LazyIterator
,LPTopGoalIterator
,Map1Iterator
,MapFilterIterator
,NiceIterator
,NodeIteratorImpl
,NsIteratorImpl
,NullIterator
,ObjectIterator
,RandomOrderIterator
,ResIteratorImpl
,RSIteratorImpl
,SafeTripleIterator
,SeqNodeIteratorImpl
,SingletonIterator
,StmtIteratorImpl
,StoreTripleIterator
,TrackingTripleIterator
,WrappedIterator
public interface ClosableIterator<T> extends IteratorCloseable<T>
An iterator which should be closed after use. Some iterators take up resources which should be free'd as soon as possible, eg large structures which can be discarded early, or external resources such as database cursors.Users of ClosableIterators (and thus of ExtendedIterator) should close the iterator if they are done with it before it is exhausted (i.e. hasNext() is still true). If they do not, resources may leak, be reclaimed unpredictably or much later than convenient. It is harmless to close the iterator once it has become exhausted and to call close multiple times.
Implementors are encouraged to dispose of resources as soon as is convenient.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Close the iterator.
-