public interface CloseableIterator<T>
extends java.util.Iterator<T>, java.io.Closeable
close()
operation. Note that the iterators in this API may throw UncheckedRepositoryException
. Example use:
CloseableIterator<DataElement> iter = dobj.listDataElements();
try {
while (iter.hasNext()) {
DataElement element = iter.next();
// ...
}
} catch (UncheckedRepositoryException e) {
e.throwCause();
}
finally {
iter.close();
}
CollectionUtil.forEach(Iterator)
Modifier and Type | Method and Description |
---|---|
void |
close() |