private int nextPage=1;
private int previouPage=1;
private int lastPage=1;
private int firstPage=1;
private int currentPage=1;
this.currentPage=nowPage;
calcuPage(nowPage,pageSize,total);
}
public void calcuPage(int nowPage,int pageSize,int total) {
if((nowPage-1)*pageSize>=total){//total为空时
nowPage-=1;
currentPage=nowPage;
}
if(nowPage*pageSize<total){
nextPage=nowPage+1;
}
else{
nextPage=nowPage;
}
if(nowPage<=1){
previouPage=1;
}
else{
previouPage=nowPage-1;
}
firstPage=total==0?0:1;
lastPage=total%pageSize==0?total/pageSize:total/pageSize+1;
}
public int getNextPage() {
return nextPage;
}
public int getPreviouPage() {
return previouPage;
}
public int getLastPage() {
return lastPage;
}
public int getFirstPage() {
return firstPage;
}
public int getCurrentPage() {
return currentPage;
}