📄 page.java
字号:
package com.web.util;
import java.util.*;
import java.io.Serializable;
//public class Page implements Serializable {
public class Page {
public static int defaultPageSize = 15;
private int rowsPerPage = 10;
private long curPage; //当前是第几页
private long maxPage; //一共有多少页
private long maxRowCount; //一共有多少行
private long pageNum = 1;
private List data;
public Page(List data, long rowsCount, int pageNum, int pageSize) {
this.data = data;
this.maxRowCount = rowsCount;
this.pageNum = pageNum;
this.rowsPerPage = pageSize;
//Caculate maxPage
if (this.maxRowCount % this.rowsPerPage == 0) {
this.maxPage = this.maxRowCount / this.rowsPerPage;
} else {
this.maxPage = this.maxRowCount / this.rowsPerPage + 1;
}
//System.out.println("总记录数量:" + rowsCount + " 最大页码:" + this.maxPage + " 每页行数:" + pageSize);
}
public List getItems() {
return data;
}
public long getCurPage() {
return this.curPage;
}
public long getMaxPage() {
return this.maxPage;
}
public long getMaxRowCount() {
return maxRowCount;
}
public long getRowsPerPage() {
return this.rowsPerPage;
}
public long getPageNum() {
return this.pageNum;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -