com.pow2.dao.datalist
Class ResultSetDataListChunk

java.lang.Object
  extended bycom.pow2.dao.datalist.ResultSetDataListChunk
All Implemented Interfaces:
DataList, ResultSetDataList

public class ResultSetDataListChunk
extends Object
implements ResultSetDataList

ResultSetDataListChunk class.

Author:
Claudio Fratarcangeli

Field Summary
protected static org.apache.log4j.Category cat
          Log4J category.
 
Constructor Summary
ResultSetDataListChunk(ResultSetDataList rsDataList, int firstElementIndex, int countOfElements)
          Constructor
 
Method Summary
 boolean absolute(int index)
          Move the resultSetDataListChunk cursor to a specific row number.
 void beforeFirst()
          Move the resultSetDataListChunk cursor before the first row of the list.
 void close()
          Close the data list.
 boolean elementExists(int index)
          Check if any element exist at the index poition.
 Object get(int index, Object obj)
          Put object state in item and return it.
 boolean hasNext()
          Check if the resultSet data list has got another element.
 boolean isEmpty()
          Check if the resultSetDataListChunk is empty.
 DataListIterator iterator()
          Get the DataListIterator object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat
Log4J category.

Constructor Detail

ResultSetDataListChunk

public ResultSetDataListChunk(ResultSetDataList rsDataList,
                              int firstElementIndex,
                              int countOfElements)
Constructor

Parameters:
rsDataList - the resultSetDataList object
firstElementIndex - the index of the first element of the chunk
countOfElements - the number of the chunk elements
Method Detail

iterator

public DataListIterator iterator()
                          throws Exception
Get the DataListIterator object.

Specified by:
iterator in interface DataList
Returns:
the DataListIterator object
Throws:
Exception - if any error occurs

close

public void close()
           throws Exception
Close the data list.
Implementation note: do not close this object !!

Specified by:
close in interface DataList
Throws:
Exception - if any error occurs

get

public Object get(int index,
                  Object obj)
           throws Exception
Put object state in item and return it.
Use rowMapper to map fields of ResultSet to instance variables of item. ResultSet index ranges from 1, while ResultSetDataList index ranges from 0.

Specified by:
get in interface DataList
Parameters:
index - the index value
obj - the item object to fill
Returns:
the item object filled with values retrieved from the resultSet, or null if the input index is out of the bondaries of the chunk
Throws:
Exception - if any error occurs

hasNext

public boolean hasNext()
                throws Exception
Check if the resultSet data list has got another element.

Specified by:
hasNext in interface ResultSetDataList
Returns:
true if the resultSet data list has got another record, false otherwise
Throws:
Exception - if any error occurs

beforeFirst

public void beforeFirst()
                 throws Exception
Move the resultSetDataListChunk cursor before the first row of the list.

Specified by:
beforeFirst in interface ResultSetDataList
Throws:
Exception - if any error occurs

absolute

public boolean absolute(int index)
                 throws Exception
Move the resultSetDataListChunk cursor to a specific row number. Rows are numbered starting from 0.

Specified by:
absolute in interface ResultSetDataList
Parameters:
index - the cursor index value
Returns:
true if the cursor is on the result set; false otherwise
Throws:
Exception - if any error occurs

elementExists

public boolean elementExists(int index)
                      throws Exception
Check if any element exist at the index poition.

Specified by:
elementExists in interface ResultSetDataList
Parameters:
index - the index value
Returns:
true if any element exist at the index poition, false otherwise
Throws:
Exception - if any error occurs

isEmpty

public boolean isEmpty()
                throws Exception
Check if the resultSetDataListChunk is empty.

Specified by:
isEmpty in interface DataList
Returns:
true if the resultSetDataListChunk is empty; false otherwise
Throws:
Exception - if any error occurs


Copyright © 2002-2004 Power Of Two S.R.L. All Rights Reserved.