Package com.ocs.dynamo.domain.query
Class PagingDataSetIterator<ID extends Serializable,T extends AbstractEntity<ID>>
- java.lang.Object
-
- com.ocs.dynamo.domain.query.PagingDataSetIterator<ID,T>
-
- Type Parameters:
ID- the type of the primary key of the entityT- the type of the entity
- All Implemented Interfaces:
DataSetIterator<ID,T>
public abstract class PagingDataSetIterator<ID extends Serializable,T extends AbstractEntity<ID>> extends Object implements DataSetIterator<ID,T>
An iterator for traversing large data sets without loading them all into memory- Author:
- bas.rutten
-
-
Constructor Summary
Constructors Constructor Description PagingDataSetIterator(List<ID> idList)ConstructorPagingDataSetIterator(List<ID> idList, int pageSize)Constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Tnext()Returns the next entityprotected abstract List<T>readPage(List<ID> ids)Returns a page of data given a list of IDsintsize()Returns the size
-
-
-
Method Detail
-
next
public T next()
Description copied from interface:DataSetIteratorReturns the next entity- Specified by:
nextin interfaceDataSetIterator<ID extends Serializable,T extends AbstractEntity<ID>>- Returns:
-
readPage
protected abstract List<T> readPage(List<ID> ids)
Returns a page of data given a list of IDs- Parameters:
ids-- Returns:
-
size
public int size()
Returns the size- Specified by:
sizein interfaceDataSetIterator<ID extends Serializable,T extends AbstractEntity<ID>>- Returns:
-
-