|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jenkov.mrpersister.impl.filter.PageReadFilter
public class PageReadFilter
Implements a paged read filter. This is useful when you need to read for instance record 100 to 120 (or any other number) from a ResultSet. This is often used in web apps when displaying data that cannot fit into a single page. Then you only want to read the data from the ResultSet that corresponds to the page number the user is viewing.
Field Summary | |
---|---|
protected int |
pageNumber
|
protected int |
pageSize
|
protected int |
rowsAccepted
|
Constructor Summary | |
---|---|
PageReadFilter(int pageNumber,
int pageSize)
|
Method Summary | |
---|---|
boolean |
accept(java.sql.ResultSet result)
Returns true if the filter can accept the record at the current position of the result set as part of the objects read. |
void |
acceptedByAllFilters(boolean wasAcceptedByAllFilters)
If the filter is used in a combined filter, this filter can be told whether all other filters accepted this record, or not. |
boolean |
acceptMore()
Returns true if the filter will accept anymore records at all. |
void |
clear()
This method is called when all reading is done. |
void |
init(java.sql.ResultSet result)
Called by the object reader before reading starts taking place. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int pageNumber
protected int pageSize
protected int rowsAccepted
Constructor Detail |
---|
public PageReadFilter(int pageNumber, int pageSize)
Method Detail |
---|
public void init(java.sql.ResultSet result) throws java.sql.SQLException, PersistenceException
IReadFilter
init
in interface IReadFilter
result
- The ResultSet to initialize.
java.sql.SQLException
PersistenceException
public boolean accept(java.sql.ResultSet result) throws java.sql.SQLException, PersistenceException
IReadFilter
accept
in interface IReadFilter
result
- The ResultSet instance apply the filter filter to.
java.sql.SQLException
PersistenceException
public boolean acceptMore()
IReadFilter
acceptMore
in interface IReadFilter
public void acceptedByAllFilters(boolean wasAcceptedByAllFilters)
IReadFilter
acceptedByAllFilters
in interface IReadFilter
wasAcceptedByAllFilters
- Will be set to true if all filters in a combined filter
accepted the current record. Will be set to false if just one single filter do
not accept the current record.public void clear()
IReadFilter
clear
in interface IReadFilter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |