adams.flow.source
Class SpreadSheetDbReader.ChunkReader

java.lang.Object
  extended by adams.flow.source.SpreadSheetDbReader.ChunkReader
All Implemented Interfaces:
Serializable
Enclosing class:
SpreadSheetDbReader

public static class SpreadSheetDbReader.ChunkReader
extends Object
implements Serializable

For reading data from the database in chunks.

Version:
$Revision: 6549 $
Author:
fracpete (fracpete at waikato dot ac dot nz)
See Also:
Serialized Form

Field Summary
protected  int m_ChunkSize
          the chunk size.
protected  SpreadSheet m_Header
          the header.
protected  SpreadSheetDbReader m_Owner
          the owner.
protected  ResultSet m_ResultSet
          the resultset in use.
protected  int[] m_Type
          the column types.
 
Constructor Summary
SpreadSheetDbReader.ChunkReader(SpreadSheetDbReader owner)
          Initializes the reader.
 
Method Summary
 boolean hasNext()
          Returns whether there is more data to be read.
 SpreadSheet next()
          Reads the next chunk.
 SpreadSheet read(ResultSet rs, int chunkSize)
          Reads the first chunk.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_Owner

protected SpreadSheetDbReader m_Owner
the owner.


m_ChunkSize

protected int m_ChunkSize
the chunk size.


m_ResultSet

protected ResultSet m_ResultSet
the resultset in use.


m_Header

protected SpreadSheet m_Header
the header.


m_Type

protected int[] m_Type
the column types.

Constructor Detail

SpreadSheetDbReader.ChunkReader

public SpreadSheetDbReader.ChunkReader(SpreadSheetDbReader owner)
Initializes the reader.

Parameters:
owner - the owning DB reader
Method Detail

read

public SpreadSheet read(ResultSet rs,
                        int chunkSize)
Reads the first chunk.

Parameters:
rs - the resultset to read from
chunkSize - the size of the chunks, -1 for infinity
Returns:
the first chunk

hasNext

public boolean hasNext()
Returns whether there is more data to be read.

Returns:
true if more data available

next

public SpreadSheet next()
Reads the next chunk.

Returns:
the next chunk


Copyright © 2013 University of Waikato, Hamilton, NZ. All Rights Reserved.