public interface CloseableWrappedIterable<T> extends CloseableIterable<T>, AutoCloseable
CloseableIterator
but also can be closed itself. This allows us to do something like this pattern:
try (CloseableWrappedIterable<Foo> wrapperIterable = fooDao.getCloseableIterable();) { for (Foo foo : wrapperIterable) { ... } }
Modifier and Type | Method and Description |
---|---|
void |
close()
This will close the iterator that was wrapped.
|
closeableIterator
forEach, iterator, spliterator
void close() throws Exception
close
in interface AutoCloseable
Exception
This documentation is licensed by Gray Watson under the Creative Commons Attribution-Share Alike 3.0 License.