com.alexkasko.springjdbc.iterable
Class CloseableIterable<T>
java.lang.Object
com.alexkasko.springjdbc.iterable.CloseableIterable<T>
- All Implemented Interfaces:
- Closeable, Iterable<T>
public abstract class CloseableIterable<T>
- extends Object
- implements Iterable<T>, Closeable
Specialized Iterable partial implementation, returns closable iterators.
This class is not used directly in this library and may be used for
processing possible results for multiple queries in "passive" mode
(no DB resources are used until client call to iterator()).
Retains references to returned iterators and closes them on close() call.
- Author:
- alexkasko
Date: 6/21/13
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
iters
protected List<CloseableIterator<T>> iters
CloseableIterable
public CloseableIterable()
closeableIterator
protected abstract CloseableIterator<T> closeableIterator()
- Implementation should return new
CloseableIterator instance
- Returns:
- closeable iterator
iterator
public CloseableIterator<T> iterator()
-
- Specified by:
iterator in interface Iterable<T>
close
public void close()
-
- Specified by:
close in interface Closeable
isClosed
public boolean isClosed()
- Returns
true if all produces iterators are closed
- Returns:
true if all produces iterators are closed
false otherwise
Copyright © 2013. All Rights Reserved.