📄 pageinfo.java
字号:
package cn.ialvin.web;
public class PageInfo {
private int pageSize = 10;
private int currentPage = 1;
private int totalRecord = 0;
private String weight = "条记录";
private String queryString = "";
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
if (pageSize > 0)
this.pageSize = pageSize;
}
public int getCurrentPage() {
if (currentPage > 0)
return currentPage;
return 1;
}
public void setCurrentPage(int currentPage) {
if (currentPage > 0)
this.currentPage = currentPage;
}
public String getQueryString() {
return queryString;
}
public void setQueryString(String queryString) {
if (queryString == null) return;
this.queryString = queryString;
}
public int getTotalPage() {
if (this.totalRecord < 1) return 1;
int totalPage = this.totalRecord / this.pageSize;
if (this.totalRecord%this.pageSize != 0) totalPage++;
return totalPage;
}
public int getOffsetRecord() {
return (this.currentPage-1) * this.pageSize;
}
public int getTotalRecord() {
if (this.totalRecord > 0)
return totalRecord;
return 0;
}
public void setTotalRecord(int totalRecord) {
if (totalRecord > 0)
this.totalRecord = totalRecord;
}
public String getWeight() {
if (this.weight == null) return "";
return weight;
}
public void setWeight(String weight) {
if (this.weight == null) return;
this.weight = weight;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -