来源:百度文库 编辑:神马文学网 时间:2024/06/12 05:08:03
先是一个page的bean:
package com.leatherstore.other;
public class Page {
// 是否有上一页
private boolean hasPrePage;
//是否有下一页 private boolean hasNextPage;
// 每页的数量
private int everyPage;
// 总页数
private int totalPage;
//当前页
private int currentPage;
// 起始点
private int beginIndex;
// 总记录数
private int totalCount;
//@return totalCount
public int getTotalCount() {
return totalCount;
}
//@param totalCount 要设置的 totalCount
public void setTotalCount(int totalCount) {
this.totalCount = totalCount;
}
//The default constructor
public Page(){
}
// construct the page by everyPage
public Page(int everyPage){
this.everyPage = everyPage;
}
//The whole constructor
public Page(boolean hasPrePage, boolean hasNextPage,
int everyPage, int totalPage,
int currentPage, int beginIndex,int totalCount) {
this.hasPrePage = hasPrePage;
this.hasNextPage = hasNextPage;
this.everyPage = everyPage;
this.totalPage = totalPage;
this.currentPage = currentPage;
this.beginIndex = beginIndex;
this.totalCount = totalCount;
}
public int getBeginIndex() {
return beginIndex;
}
public void setBeginIndex(int beginIndex) {
this.beginIndex = beginIndex;
}