1
|
package eu.dnetlib.dhp.common.java.io;
|
2
|
|
3
|
import java.io.Closeable;
|
4
|
import java.util.Iterator;
|
5
|
|
6
|
/**
|
7
|
* An iterator for I/O operations that can be {@code close}d explicitly to
|
8
|
* release the resources it holds.
|
9
|
*
|
10
|
* You should call {@code close} only when interrupting the iteration in the
|
11
|
* middle since in such situation there is no way for the iterator to know if
|
12
|
* you're going to continue the iteration and it should still hold the resources
|
13
|
* or not. There's no need to call {@code close} when iterating over all
|
14
|
* elements since in such situation it is called automatically after the
|
15
|
* end of iteration.
|
16
|
*
|
17
|
* @author mhorst
|
18
|
*
|
19
|
* @param <E>
|
20
|
*/
|
21
|
public interface CloseableIterator<E> extends Iterator<E>, Closeable {
|
22
|
|
23
|
|
24
|
}
|
25
|
|