T
- the type of elements returned by the CloseableIterator
.public abstract class AbstractCloseableIterable<T> extends java.lang.Object implements CloseableIterable<T>
CloseableIterable
that wraps an Iterable
.Constructor and Description |
---|
AbstractCloseableIterable(java.lang.Iterable<T> original)
New instance.
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
closeIterator(java.util.Iterator<T> iterator)
Closes an
Iterator as returned by Iterable.iterator() of the Iterable that is wrapped by
this AbstractCloseableIterable . |
CloseableIterator<T> |
iterator() |
public AbstractCloseableIterable(java.lang.Iterable<T> original)
original
- Iterable
that is wrapped by this AbstractCloseableIterable
.public CloseableIterator<T> iterator()
iterator
in interface CloseableIterable<T>
iterator
in interface java.lang.Iterable<T>
protected abstract void closeIterator(java.util.Iterator<T> iterator) throws java.lang.Exception
Iterator
as returned by Iterable.iterator()
of the Iterable
that is wrapped by
this AbstractCloseableIterable
.iterator
- Iterator
to close.java.lang.Exception
- if close failed.