public interface CloseableIterator<E> extends Iterator<E>, AutoCloseable
CloseableIterator
is intended to be used when it may hold resources (such as file or socket handles).
This allows implementations to clean up any resources they need to keep open to iterate over elements.Modifier and Type | Method and Description |
---|---|
void |
close() |
forEachRemaining, hasNext, next, remove
void close()
close
in interface AutoCloseable