Package org.apache.flink.util
Interface CloseableIterator<T>
- Type Parameters:
T- the type of iterated elements.
- All Superinterfaces:
AutoCloseable,Iterator<T>
- All Known Implementing Classes:
CloseableIterator.IteratorAdapter
This interface represents an
Iterator that is also AutoCloseable. A typical
use-case for this interface are iterators that are based on native-resources such as files,
network, or database connections. Clients must call AutoCloseable.close() after using the iterator.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classAdapter fromIteratortoCloseableIterator. -
Field Summary
Fields -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic <T> CloseableIterator<T>adapterForIterator(Iterator<T> iterator) static <T> CloseableIterator<T>adapterForIterator(Iterator<T> iterator, AutoCloseable close) static <T> CloseableIterator<T>empty()static <T> CloseableIterator<T>flatten(CloseableIterator<T>... iterators) static <T> CloseableIterator<T>static <E> CloseableIterator<E>static <T> CloseableIterator<T>ofElements(Consumer<T> closeNotConsumed, T... elements) Methods inherited from interface java.lang.AutoCloseable
closeMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Field Details
-
EMPTY_INSTANCE
-
-
Method Details
-
adapterForIterator
-
adapterForIterator
static <T> CloseableIterator<T> adapterForIterator(@Nonnull Iterator<T> iterator, AutoCloseable close) -
fromList
-
flatten
-
empty
-
ofElements
-
ofElement
-