E
- public class CloseAtEndIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Iterator
that automatically closes a resource when the end of the iteration is
reached.Constructor and Description |
---|
CloseAtEndIterator(java.util.Iterator<E> iterator,
java.lang.AutoCloseable closeable) |
Modifier and Type | Method and Description |
---|---|
void |
forEachRemaining(java.util.function.Consumer<? super E> action) |
boolean |
hasNext() |
E |
next() |
void |
remove() |
public CloseAtEndIterator(java.util.Iterator<E> iterator, java.lang.AutoCloseable closeable)