public class PageHandler extends Object implements Serializable
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PAGE_SIZE
默认每页数据条数
|
static int |
MAX_PAGE_SIZE
最大每页数据条数
|
Constructor and Description |
---|
PageHandler(Integer pageIndex,
Integer pageSize,
int totalCount,
Integer maxPages) |
PageHandler(Integer pageIndex,
Integer pageSize,
long totalCount,
Integer maxPages) |
Modifier and Type | Method and Description |
---|---|
int |
getFirstResult()
第一条结果
|
List<?> |
getList()
结果数据
|
int |
getNextPage()
下一页
|
int |
getPageIndex()
当前页码
|
int |
getPageSize()
每页数据条数
|
int |
getPrePage()
上一页
|
int |
getTotalCount()
总数据条数
|
int |
getTotalPage()
总页数
|
void |
init()
初始化
|
boolean |
isFirstPage()
是否第一页
|
boolean |
isLastPage()
是否最后一页
|
void |
setList(List<?> list) |
void |
setPageIndex(int pageIndex) |
void |
setPageSize(int pageSize) |
void |
setTotalCount(int totalCount) |
void |
setTotalCount(int totalCount,
Integer maxPages) |
public static final int DEFAULT_PAGE_SIZE
public static final int MAX_PAGE_SIZE
public PageHandler(Integer pageIndex, Integer pageSize, long totalCount, Integer maxPages)
pageIndex
- pageSize
- totalCount
- maxPages
- public void init()
public int getTotalPage()
public int getFirstResult()
public int getTotalCount()
public void setTotalCount(int totalCount)
totalCount
- the totalCount to setpublic void setTotalCount(int totalCount, Integer maxPages)
totalCount
- maxPages
- public int getPageSize()
public void setPageSize(int pageSize)
pageSize
- the pageSize to setpublic int getPageIndex()
public void setPageIndex(int pageIndex)
pageIndex
- the pageIndex to setpublic List<?> getList()
public void setList(List<?> list)
list
- the list to setpublic boolean isFirstPage()
public boolean isLastPage()
public int getNextPage()
public int getPrePage()
Copyright © 2018. All rights reserved.