|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PagingIterator<T>
The PagingIterator
interface is returned by a paged search
using com.ibm.portal.um.PumaLocator
.
A paged search does not return all results at once but an iterator that
partitions the results set into subsets (pages) of a specified size. This
iterator also offers a random access mode.
As implementations of this iterator might choose to lazy-load pages, the
get...Page methods throw PumaSystemException and PumaModelExcpetion to
reflect problems during backend lookup.
PumaLocator
Method Summary | |
---|---|
int |
getCurrentPageNumber()
Returns the page number of the page that was recently requested or -1 if no page has been requested yet. |
java.util.List<T> |
getFirstPage(java.util.List<T> buffer)
This method returns the first page of search results. |
java.util.List<T> |
getLastPage(java.util.List<T> buffer)
This method returns the last page of search results. |
java.util.List<T> |
getNextPage(java.util.List<T> buffer)
This method returns the next page of search results if available. |
int |
getNumberOfPages()
Returns the number of pages that were found by the search request. |
int |
getNumberOfTotalResults()
Returns the size of the complete result set. |
java.util.List<T> |
getPage(java.util.List<T> buffer,
int pageNumber)
This method returns the page with the given number if available |
java.util.List<T> |
getPreviousPage(java.util.List<T> buffer)
This method returns the previous page of search results if available. |
boolean |
hasNextPage()
Returns true if there is a next page available. |
boolean |
hasPreviousPage()
Returns true if there is a previous page available. |
Method Detail |
---|
int getCurrentPageNumber()
int getNumberOfPages()
getNumberOfTotalResults()
returns
0. In that case the first page will not contain any entries.
int getNumberOfTotalResults()
boolean hasNextPage()
true
if there is a next page available. (In other
words, returns true
if getNextPage
would
return an element rather than throwing an exception.)
java.util.List<T> getNextPage(java.util.List<T> buffer) throws PumaModelException, PumaSystemException
getPage(buffer, getCurrentPageNumber()+1)
buffer
- - a modifiable list that will be cleared and filled or null
PumaSystemException
- if lazy loading of a page fails
PumaModelException
- if the requeted page is not available or if
lazy loading of a page failsboolean hasPreviousPage()
true
if there is a previous page available. (In
other words, returns true
if getPreviousPage
would return an element rather than throwing an exception.)
java.util.List<T> getPreviousPage(java.util.List<T> buffer) throws PumaModelException, PumaSystemException
getPage(buffer, getCurrentPageNumber()-1)
buffer
- - a modifiable list that will be cleared and filled or null
PumaSystemException
- if lazy loading of a page fails
PumaModelException
- if the requeted page is not available or if
lazy loading of a page failsjava.util.List<T> getFirstPage(java.util.List<T> buffer) throws PumaModelException, PumaSystemException
buffer
- - a modifiable list that will be cleared and filled or null
PumaSystemException
- if lazy loading of a page fails
PumaModelException
- if the requeted page is not available or if
lazy loading of a page failsjava.util.List<T> getLastPage(java.util.List<T> buffer) throws PumaModelException, PumaSystemException
buffer
- - a modifiable list that will be cleared and filled or null
PumaSystemException
- if lazy loading of a page fails
PumaModelException
- if the requeted page is not available or if
lazy loading of a page failsjava.util.List<T> getPage(java.util.List<T> buffer, int pageNumber) throws PumaModelException, PumaSystemException
buffer
- - a modifiable list that will be cleared and filled or null
PumaSystemException
- if lazy loading of a page fails
PumaModelException
- if the requeted page is not available or if
lazy loading of a page fails
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |