Package org.infinispan.commons.util
Interface CloseableIteratorCollection<E>
- All Superinterfaces:
Collection<E>
,Iterable<E>
- All Known Subinterfaces:
CacheCollection<E>
,CacheSet<E>
,CloseableIteratorSet<E>
- All Known Implementing Classes:
AbstractCacheBackedSet
,CacheBackedEntrySet
,CacheBackedKeySet
,CacheSetMapper
,CloseableIteratorCollectionAdapter
,CloseableIteratorSetAdapter
,InternalCacheSet
,SimpleCacheImpl.CacheEntrySet
,SimpleCacheImpl.EntrySet
,SimpleCacheImpl.EntrySetBase
,SimpleCacheImpl.KeySet
,SimpleCacheImpl.Values
,WriteableCacheCollectionMapper
,WriteableCacheSetMapper
A collection that defines an iterator method that returns a
CloseableIterator
instead of a non closeable one. This is needed so that iterators can be properly cleaned up. All other
methods will internally clean up any iterators created and don't have other side effects.- Since:
- 7.0
- Author:
- wburns
-
Method Details
-
iterator
CloseableIterator<E> iterator()This iterator should be explicitly closed when iteration upon it is completed. Failure to do so could cause resources to not be freed properly
-
spliterator
CloseableSpliterator<E> spliterator()This spliterator should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
spliterator
in interfaceCollection<E>
- Specified by:
spliterator
in interfaceIterable<E>
-
stream
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
stream
in interfaceCollection<E>
-
parallelStream
This stream should be explicitly closed after it has been used. Failure to do so could cause resources to not be freed properly
- Specified by:
parallelStream
in interfaceCollection<E>
-