T - The type of elements being extractedjava.lang.AutoCloseable, java.util.Iterator<T>public class ResultSetIterator<T>
extends java.lang.Object
implements java.util.Iterator<T>, java.lang.AutoCloseable
| Constructor | Description |
|---|---|
ResultSetIterator(java.sql.ResultSet resultSet,
Extractor<T> extractor) |
Create an instance with with a ResultSet to iterate over, and an Extractor to apply to
each row.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
close() |
|
boolean |
hasNext() |
|
T |
next() |
|
ResultSetIterator<T> |
onClose(java.lang.Runnable runnable) |
Add a Runnable to be invoked when this instance is closed.
|
public boolean hasNext()
hasNext in interface java.util.Iterator<T>public ResultSetIterator<T> onClose(java.lang.Runnable runnable)
runnable - a runnablepublic void close()
throws java.sql.SQLException
close in interface java.lang.AutoCloseablejava.sql.SQLException