Interface CloseableIterator<E>
- All Superinterfaces:
java.lang.AutoCloseable,java.util.Iterator<E>
- All Known Implementing Classes:
FunctionIterator
public interface CloseableIterator<E>
extends java.util.Iterator<E>, java.lang.AutoCloseable
A
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.- Since:
- 4.3.15
-
Method Summary
Modifier and Type Method Description voidclose()
-
Method Details
-
close
void close()- Specified by:
closein interfacejava.lang.AutoCloseable
-