package com.pm360.pip.util.vo;
import java.math.BigDecimal;
import java.util.List;
public class Pagination
{
private int pageIndex=1;//当前页(默认第一页)
private int pageCount=10;//每页显示的记录数(默认每页显示10条记录)
private int pageBeginCount;//当前页记录数起始位置
private int totalCount;//总记录数
private int totalPageIndex;//总页数
private List<Integer> pageIndexList;
public int getPageIndex() {
return pageIndex;
}
public void setPageIndex(int pageIndex) {
this.pageIndex = pageIndex;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public int getPageBeginCount(int pageIndex,int pageCount) {
pageBeginCount=(pageIndex-1)*pageCount;
return pageBeginCount;
}
public void setPageBeginCount(int pageBeginCount) {
this.pageBeginCount = pageBeginCount;
}
public int getTotalCount() {
return totalCount;
}
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
public int getTotalPageIndex() {
return totalPageIndex;
}
public void setTotalPageIndex(int totalCount,int pageCount,int totalPageIndex) {
BigDecimal bdtotalCount=new BigDecimal(totalCount);
BigDecimal bdPageCount=new BigDecimal(pageCount);
totalPageIndex=(int) Math.ceil((bdtotalCount.divide(bdPageCount,2)).doubleValue());
this.totalPageIndex = totalPageIndex;
}
public List<Integer> getPageIndexList() {
return pageIndexList;
}
public void setPageIndexList(int totalPageIndex,List<Integer>pageIndexList) {
for (int i = 1; i <= totalPageIndex; i++)
{
pageIndexList.add(i);
}
this.pageIndexList = pageIndexList;
}
}