xxl.relational
Class ResultSetCursor

java.lang.Object
  |
  +--xxl.relational.ResultSetCursor

public class ResultSetCursor
extends java.lang.Object
implements Cursor

This class serves a ResultSet as a Cursor.

When the method next of this Cursor is called, a Tuple will be created from the underlying ResultSet and this Tuple will be returned.
This Cursor does not support peek, reset, remove or update.

One can specify, which kind of tuple implementation should be used here.

Example:


	new ResultSetCursor(resultSet, ArrayTuple.FACTORY_METHOD);
	
Now the tuples of resultSet are served as ArrayTuples.

If nothing is specified, the linked list implementation will be used.

Example:


	new ResultSetCursor(resultSet);
	
Now the tuples of resultSet are served as ListTuples.


Field Summary
protected  Function createTuple
           
protected  boolean hasNext
           
protected  java.sql.ResultSet resultSet
           
 
Constructor Summary
ResultSetCursor(java.sql.ResultSet resultSet)
           
ResultSetCursor(java.sql.ResultSet resultSet, Function createTuple)
           
 
Method Summary
 void close()
           
 java.sql.ResultSet getResultSet()
           
 boolean hasNext()
           
 java.lang.Object next()
           
 void open()
           
 java.lang.Object peek()
           
 void remove()
           
 void reset()
           
 boolean supportsPeek()
           
 void update(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resultSet

protected java.sql.ResultSet resultSet

createTuple

protected Function createTuple

hasNext

protected boolean hasNext
Constructor Detail

ResultSetCursor

public ResultSetCursor(java.sql.ResultSet resultSet,
                       Function createTuple)

ResultSetCursor

public ResultSetCursor(java.sql.ResultSet resultSet)
Method Detail

open

public void open()

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Cursor

next

public java.lang.Object next()
                      throws java.util.NoSuchElementException
Specified by:
next in interface Cursor

supportsPeek

public boolean supportsPeek()
Specified by:
supportsPeek in interface Cursor

close

public void close()
Specified by:
close in interface Cursor

getResultSet

public java.sql.ResultSet getResultSet()

peek

public java.lang.Object peek()
                      throws java.util.NoSuchElementException
Specified by:
peek in interface Cursor

remove

public void remove()
            throws java.lang.IllegalStateException,
                   java.lang.UnsupportedOperationException
Specified by:
remove in interface Cursor

reset

public void reset()
           throws java.lang.UnsupportedOperationException
Specified by:
reset in interface Cursor

update

public void update(java.lang.Object object)
            throws java.lang.IllegalStateException,
                   java.lang.UnsupportedOperationException
Specified by:
update in interface Cursor