com.ibm.portal
Interface PagedIterator<E>


public interface PagedIterator<E>

An iterator that provides paging support for data provided by it. The paged iterator allows to skip a number of elements in the data it holds and to retrieve elements in chunks (arrays of fixed size). The paged iterator is provided by the PagedListModel.

Example of usage:

 Object[] chunk = new Object[10];
 PagedListModel model = ...;
 PagedIterator i = model.getPagedIterator();
 i.skip(100);  // skip the first 100 elements
 while (i.next(chunk) > 0) {
     // do something with the results
 };
 

Since:
5.1.0.1

Method Summary
 int next(E[] chunk)
          Retrieves the next objects from the paged iterator.
 int skip(int number)
          Skips the given number of elements contained in the paged iterator.
 

Method Detail

next

int next(E[] chunk)
Retrieves the next objects from the paged iterator. The number of elements fetched is equal to or smaller than the size of the array.

Parameters:
chunk - an array to be filled with elements held by the iterator
Returns:
the number of objects actually put into the chunk array. Returns 0 if no more entries are available.

skip

int skip(int number)
Skips the given number of elements contained in the paged iterator.

Parameters:
number - the number of elements to skip
Returns:
the number of elements actually skipped