📄 page.java
字号:
package bean;
public class Page {
private int totalPage;//总页数
private int currentPage;//当前页数
private int totalRecord;//总的记录条数
private int currentRecord;//当前记录的条数
private int pageSize = 12;//每页显示的记录数量,这里默认每页显示12条
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentRecord,int pageSize ) {
//如果当前记录数除以每页显示条数可以整除,商就是当前的页码
if(currentRecord%pageSize == 0)
{
currentPage = currentRecord/pageSize;
}else
{
//如果当前记录数除以每页显示条数不能整除,商加1才是当前的页码
currentPage = currentRecord/pageSize+1;
}
}
public int getCurrentRecord() {
return currentRecord;
}
public void setCurrentRecord(int currentRecord) {
this.currentRecord = currentRecord;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalRecord,int pageSize) {
//如果总记录数除以每页显示条数可以整除,商就是总页码
if(totalRecord%pageSize == 0)
{
totalPage = totalRecord/pageSize;
}else
{
//如果总记录数除以每页显示条数不能整除,商加1才是总页码
totalPage = totalRecord/pageSize+1;
}
}
public int getTotalRecord() {
return totalRecord;
}
public void setTotalRecord(int totalRecord) {
this.totalRecord = totalRecord;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -