public interface CloseableIterable<T> extends Iterable<T>, Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
default void |
closeQuietly()
Unconditionally closes the iterator.
|
default Stream<T> |
stream()
Returns a sequential
Stream with this iterable as its source. |
forEach, iterator, spliteratorvoid close()
close in interface AutoCloseableclose in interface Closeabledefault void closeQuietly()
Unconditionally closes the iterator.
Equivalent to close(), except any exceptions will be ignored.
default Stream<T> stream()
Stream with this iterable as its source. The resulting stream also close the
underlying resource if it BaseStream.close() method is called.
This method should be overridden when the Iterable.spliterator()
method cannot return a spliterator that is IMMUTABLE,
CONCURRENT, or late-binding. (See Iterable.spliterator()
for details.)
Copyright © 2019 Calrissian. All rights reserved.