org.eigenbase.runtime
Class ResultSetIterator
java.lang.Object
org.eigenbase.runtime.ResultSetIterator
- All Implemented Interfaces:
- Iterator, RestartableIterator
public class ResultSetIterator
- extends Object
- implements RestartableIterator
A ResultSetIterator
is an adapter which converts a ResultSet
to a Iterator
.
NOTE jvs 21-Mar-2006: This class is no longer used except by Saffron, but
is generally useful. Should probably be moved to a utility package.
Method Summary |
boolean |
hasNext()
|
protected Object |
makeRow()
Creates an object representing the current row of the result set. |
private void |
moveToNext()
|
Object |
next()
|
void |
remove()
|
void |
restart()
Restarts this iterator, so that a subsequent call to next() returns the
first element in the collection being iterated. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
resultSet
protected ResultSet resultSet
row
private Object row
endOfStream
private boolean endOfStream
ResultSetIterator
public ResultSetIterator(ResultSet resultSet)
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator
next
public Object next()
- Specified by:
next
in interface Iterator
remove
public void remove()
- Specified by:
remove
in interface Iterator
restart
public void restart()
- Description copied from interface:
RestartableIterator
- Restarts this iterator, so that a subsequent call to next() returns the
first element in the collection being iterated.
- Specified by:
restart
in interface RestartableIterator
makeRow
protected Object makeRow()
throws SQLException
- Creates an object representing the current row of the result set. The
default implementation of this method returns a
Row
, but derived
classes may override this.
- Throws:
SQLException
moveToNext
private void moveToNext()