org.eigenbase.runtime
Class IteratorResultSet

java.lang.Object
  extended by org.eigenbase.jdbc4.Unwrappable
      extended by org.eigenbase.util14.AbstractResultSet
          extended by org.eigenbase.runtime.AbstractIterResultSet
              extended by org.eigenbase.runtime.IteratorResultSet
All Implemented Interfaces:
ResultSet

public class IteratorResultSet
extends AbstractIterResultSet

A IteratorResultSet is an adapter which converts a Iterator into a ResultSet.

See also its converse adapter, ResultSetIterator


Nested Class Summary
 
Nested classes/interfaces inherited from class org.eigenbase.runtime.AbstractIterResultSet
AbstractIterResultSet.ColumnGetter, AbstractIterResultSet.FieldGetter, AbstractIterResultSet.MetaData, AbstractIterResultSet.SingletonColumnGetter, AbstractIterResultSet.SqlTimeoutException, AbstractIterResultSet.SyntheticColumnGetter
 
Field Summary
private  Iterator iterator
           
private  TimeoutQueueIterator timeoutIter
           
 
Fields inherited from class org.eigenbase.runtime.AbstractIterResultSet
current, row, timeoutMillis
 
Fields inherited from class org.eigenbase.util14.AbstractResultSet
fetchSize, maxRows, wasNull
 
Fields inherited from interface java.sql.ResultSet
CLOSE_CURSORS_AT_COMMIT, CONCUR_READ_ONLY, CONCUR_UPDATABLE, FETCH_FORWARD, FETCH_REVERSE, FETCH_UNKNOWN, HOLD_CURSORS_OVER_COMMIT, TYPE_FORWARD_ONLY, TYPE_SCROLL_INSENSITIVE, TYPE_SCROLL_SENSITIVE
 
Constructor Summary
IteratorResultSet(Iterator iterator, AbstractIterResultSet.ColumnGetter columnGetter)
          Creates a result set based upon an iterator.
 
Method Summary
 void close()
           
 boolean next()
           
 void setTimeout(long timeoutMillis)
          Sets the timeout that this IteratorResultSet will wait for a row from the underlying iterator.
 
Methods inherited from class org.eigenbase.runtime.AbstractIterResultSet
getFetchSize, getMetaData, getRaw, getRow, isAfterLast, isBeforeFirst, isFirst, isLast, setFetchSize
 
Methods inherited from class org.eigenbase.util14.AbstractResultSet
absolute, afterLast, beforeFirst, cancelRowUpdates, clearWarnings, deleteRow, findColumn, first, getArray, getArray, getAsciiStream, getAsciiStream, getBigDecimal, getBigDecimal, getBigDecimal, getBigDecimal, getBinaryStream, getBinaryStream, getBlob, getBlob, getBoolean, getBoolean, getByte, getByte, getBytes, getBytes, getCharacterStream, getCharacterStream, getClob, getClob, getConcurrency, getCursorName, getDate, getDate, getDate, getDate, getDouble, getDouble, getFetchDirection, getFloat, getFloat, getHoldability, getInt, getInt, getLong, getLong, getNCharacterStream, getNCharacterStream, getNClob, getNClob, getNString, getNString, getObject, getObject, getObject, getObject, getRaw, getRef, getRef, getRowId, getRowId, getShort, getShort, getSQLXML, getSQLXML, getStatement, getString, getString, getTime, getTime, getTime, getTime, getTimestamp, getTimestamp, getTimestamp, getTimestamp, getType, getUnicodeStream, getUnicodeStream, getURL, getURL, getWarnings, insertRow, isClosed, last, moveToCurrentRow, moveToInsertRow, newConversionError, newConversionError, newDirectionError, newFetchError, newUpdatabilityError, previous, refreshRow, relative, rowDeleted, rowInserted, rowUpdated, setFetchDirection, setMaxRows, updateArray, updateArray, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateAsciiStream, updateBigDecimal, updateBigDecimal, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBinaryStream, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBlob, updateBoolean, updateBoolean, updateByte, updateByte, updateBytes, updateBytes, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateCharacterStream, updateClob, updateClob, updateClob, updateClob, updateClob, updateClob, updateDate, updateDate, updateDouble, updateDouble, updateFloat, updateFloat, updateInt, updateInt, updateLong, updateLong, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNCharacterStream, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNClob, updateNString, updateNString, updateNull, updateNull, updateObject, updateObject, updateObject, updateObject, updateRef, updateRef, updateRow, updateRowId, updateRowId, updateShort, updateShort, updateSQLXML, updateSQLXML, updateString, updateString, updateTime, updateTime, updateTimestamp, updateTimestamp, wasNull
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iterator

private final Iterator iterator

timeoutIter

private TimeoutQueueIterator timeoutIter
Constructor Detail

IteratorResultSet

public IteratorResultSet(Iterator iterator,
                         AbstractIterResultSet.ColumnGetter columnGetter)
Creates a result set based upon an iterator. The column-getter accesses columns based upon their ordinal.

"Precondition:"
iterator != null
Method Detail

setTimeout

public void setTimeout(long timeoutMillis)
Sets the timeout that this IteratorResultSet will wait for a row from the underlying iterator.

Overrides:
setTimeout in class AbstractIterResultSet
Parameters:
timeoutMillis - Timeout in milliseconds. Must be greater than zero.

close

public void close()
           throws SQLException
Specified by:
close in interface ResultSet
Overrides:
close in class AbstractResultSet
Throws:
SQLException

next

public boolean next()
             throws SQLException
Throws:
SQLException