Interface CloseableIterator<E>
- Type Parameters:
E
- the iterator element type.
- All Superinterfaces:
AutoCloseable
,Iterator<E>
- All Known Implementing Classes:
FunctionIterator
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
- Author:
- Ruslan Stelmachenko, Gary Russell
-
Method Summary
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
close
void close()- Specified by:
close
in interfaceAutoCloseable
-