分类:
2008-10-17 14:26:00
本案主要功能是完成数据集的分页显示。示例代码如下:
1.PageInfo类:定义分页信息。
/******************program begin**************************/
package test;
import java.io.*;
public final class PaginationInfo
implements Serializable {
/**页大小描述每页有多少行*/
private int pageSize = 20;
/**是否有上一页*/
private boolean hasPrevious;
/**是否有下一页*/
private boolean hasNext;
/**总行数 */
private int total;
/**总页数 */
private int totalPage;
/**当前页码*/
private int currentPageNumber=1;
/**跳转动作:1:首页;2:前一页;3:后一页;4:末页*/
private int jumpState;
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageSize() {
return pageSize;
}
public void setHasPrevious(boolean hasPrevious) {
this.hasPrevious = hasPrevious;
}
public boolean getHasPrevious() {
return hasPrevious;
}
public void setPreviousPageNumber(int previousPageNumber) {
this.previousPageNumber = previousPageNumber;
}
public int getPreviousPageNumber() {
return previousPageNumber;
}
public void setHasNext(boolean hasNext) {
this.hasNext = hasNext;
}
public boolean getHasNext() {
return hasNext;
}
public void setNextPageNumber(int nextPageNumber) {
this.nextPageNumber = nextPageNumber;
}
public int getNextPageNumber() {
return nextPageNumber;
}
public void setTotal(int total) {
this.total = total;
}
public int getTotal() {
return total;
}
public void setTotalPage(int totalPage) {
this.totalPage=totalPage;
}
public int getTotalPage() {
return totalPage;
}
public void setCurrentPageNumber(int currentPageNumber) {
this.currentPageNumber=currentPageNumber;
}
public int getCurrentPageNumber() {
return currentPageNumber;
}
public void setJumpState(int jumpState){
this.jumpState=jumpState;
}
public int getJumpState(){
return jumpState;
}
}
[1]