T - The type of object to page.public interface ResultPager<T> extends AutoCloseable
The ResultPager defines an interface for paging through the results of a
query. Methods are provided to set the number of objects to display per page
and the current page number. When these values change the implementation will
update the information about the number of pages and if the current page is
the first/last page or has previous/next pages that allow user interfaces to
display the appropriate navigation controls. The getList() method is
used to return the List of objects in the current page.
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
int |
getEndIndex()
Get the index of the last object in the current page.
|
List<T> |
getList()
Get the list of objects in the current page.
|
int |
getNextPageNumber()
Get the page number of the next page.
|
int |
getNumPages()
Get the number of pages.
|
int |
getNumResults()
Get the total number of results returned.
|
int |
getPageNumber()
Get the page number of the current page.
|
int |
getPageSize()
Get the number of objects to display in a page.
|
int |
getPreviousPageNumber()
Get the page number of the previous page.
|
int |
getStartIndex()
Get the index of the first object in the current page.
|
boolean |
hasNextPage()
Check to see if there is a next page.
|
boolean |
hasPreviousPage()
Check to see if there is a previous page.
|
boolean |
isFirstPage()
Check to see if this is the first page.
|
boolean |
isLastPage()
Check to see if this is the last page.
|
void |
setPageNumber(int pageNumber)
Set the current page number.
|
void |
setPageNumberAndSize(int pageSize,
int pageNumber) |
void |
setPageSize(int pageSize)
Set the number of objects per page.
|
void close()
close in interface AutoCloseableint getEndIndex()
List<T> getList()
int getNextPageNumber()
int getNumPages()
int getNumResults()
int getPageNumber()
int getPageSize()
int getPreviousPageNumber()
int getStartIndex()
boolean hasNextPage()
boolean hasPreviousPage()
boolean isFirstPage()
boolean isLastPage()
void setPageNumber(int pageNumber)
pageNumber - The current page number.void setPageNumberAndSize(int pageSize,
int pageNumber)
void setPageSize(int pageSize)
pageSize - The number of objects per page.Copyright © 2015 Revolution Systems Inc.. All rights reserved.