T
- the type of elements returned by the iteratorpublic abstract class CloseableIterator<T> extends CloseableResource<Iterator<T>>
CloseableIterator<T>
is an iterator which requires cleanup when it is no longer in use.Constructor and Description |
---|
CloseableIterator(Iterator<T> iterator)
Creates a
CloseableIterator wrapper around the given iterator. |
Modifier and Type | Method and Description |
---|---|
static <T> CloseableIterator<T> |
concat(CloseableIterator<T> a,
CloseableIterator<T> b)
Combines two iterators into a single iterator.
|
static <T> CloseableIterator<T> |
concat(List<CloseableIterator<T>> iterators)
Concatenate iterators.
|
static <T> CloseableIterator<T> |
noopCloseable(Iterator<? extends T> iterator)
Wrap around an iterator with no resource to close.
|
close, closeResource, get
public CloseableIterator(Iterator<T> iterator)
CloseableIterator
wrapper around the given iterator. This iterator will
be returned by the CloseableResource.get()
method.iterator
- the resource to wrappublic static <T> CloseableIterator<T> noopCloseable(Iterator<? extends T> iterator)
T
- the type of the iterableiterator
- the iterator to wrap aroundpublic static <T> CloseableIterator<T> concat(CloseableIterator<T> a, CloseableIterator<T> b)
T
- type of iteratora
- an iteratorb
- another iteratorpublic static <T> CloseableIterator<T> concat(List<CloseableIterator<T>> iterators)
T
- type of iteratoriterators
- a list of iteratorsCopyright © 2023. All Rights Reserved.