pageinfo.java
来自「又一个课程设计 简易 JSP 论坛 功能较简单的那种, 界面上模仿了 Disc」· Java 代码 · 共 59 行
JAVA
59 行
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 + =
减小字号Ctrl + -
显示快捷键?