码迷,mamicode.com
首页 > 其他好文 > 详细

分页-Page

时间:2015-05-16 13:13:12      阅读:106      评论:0      收藏:0      [点我收藏+]

标签:

public void setPageSize(int pageSize) {
if(pageSize>0)
this.pageSize = pageSize;
}
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
if(recordCount>0){
this.recordCount = recordCount;
this.setTotalPageCountByRs();

}

}

//设置总页数
private void setTotalPageCountByRs(){
if(this.recordCount%this.pageSize==0)
this.totalPageCount=this.recordCount/this.pageSize;
else if(this.recordCount%this.pageSize>0)
this.totalPageCount=this.recordCount/this.pageSize+1;
else
this.totalPageCount=0;
}
//得到开始记录数
public int getStartRow(){
return (currPageNo - 1) * pageSize + 1;
}
//得到结束记录数
public int getEndRow(){
return currPageNo * pageSize;
}
}

分页-Page

标签:

原文地址:http://www.cnblogs.com/JesseCary/p/4507614.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!