public class Pager extends Object
| Constructor and Description |
|---|
Pager(int totalCount,
int offset,
int pageSize) |
| Modifier and Type | Method and Description |
|---|---|
Page |
getFirstPage() |
Page |
getLastPage() |
Page |
getNextPage() |
int |
getOffset() |
int |
getPageSize() |
Page |
getPreviousPage() |
int |
getTotalCount() |
List<Page> |
getVisiblePages()
Start algorithm, example: pagesize 10, visible pages 5, total pages 15
Current page is 4 (first 5): start at 1: 1 - 2 - 3 - 4 - 5
Current page is 12 (last 5): start at 11: 11 - 12 - 13 - 14 - 15
Current page is 8 (middle): start at 6: 6 - 7 - 8 - 9 - 10
If there is at most 1 page, an empty list is returned.
|
public int getTotalCount()
public Page getFirstPage()
Page in paging that is the first possible page
or null if no such navigation item is needed (first page is current)public Page getPreviousPage()
Page in paging that goes to the previous page
or null if no such item is needed (first page is current)public Page getNextPage()
Page in paging that goes to the next page
or null if no such item is needed (last page is current)public Page getLastPage()
Page in paging that goes to the last possible page
or null if no such item is needed (last page is current)public List<Page> getVisiblePages()
Page's that should be visible (sliding pager),
can be emptypublic int getOffset()
public int getPageSize()
Copyright © 2009–2014 SURFnet bv, The Netherlands. All rights reserved.