public abstract class AbstractCloseableIterable<T> extends Object implements CloseableIterable<T>
CloseableIterable.
The implementation will manage all operations concerned with checks regarding
whether a resource has already been closed.
Implementations of this abstract class will have to implement the logic involved
in actually closing and retrieving the Iterator from the Iterable.| Modifier and Type | Field and Description |
|---|---|
protected boolean |
closed |
| Constructor and Description |
|---|
AbstractCloseableIterable() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
closeQuietly()
Unconditionally closes the iterator.
|
protected abstract void |
doClose()
Performes the logic to cleanup any held resources
|
Iterator<T> |
iterator() |
protected abstract Iterator<T> |
retrieveIterator()
Returns an iterator over a set of elements of type T.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorprotected abstract void doClose()
throws IOException
IOExceptionprotected abstract Iterator<T> retrieveIterator()
public void closeQuietly()
Unconditionally closes the iterator.
Equivalent to Closeable.close(), except any exceptions will be ignored.
closeQuietly in interface CloseableIterable<T>public void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionCopyright © 2018 Calrissian. All rights reserved.