📄 page.java
字号:
package edu.yinhe.mis.common;
public class Page {
private int curRow;//当前行
private int totalRows;//总行数
private int maxRowsperPage=6;//每页最大行数
private int curPage=1;//当前页
private int totalPage;//总页数
public Page(int totalRecord)
{
this.totalRows=totalRecord;
init();
}
public void init() {
if(this.getTotalRows()==0)
{
this.curPage=1;
}
if(this.getTotalRows()%this.getMaxRowsperPage()==0)
{
this.totalPage=this.getTotalRows()/this.getMaxRowsperPage();
}else
{
this.totalPage=this.getTotalRows()/this.getMaxRowsperPage()+1;
}
this.setCurRow();
}
public int getCurRow() {
return curRow;
}
public void setCurRow() {
this.curRow = (this.curPage-1)*this.maxRowsperPage;
}
public int getTotalRows() {
return totalRows;
}
public void setTotalRows(int totalRows) {
this.totalRows = totalRows;
}
public int getMaxRowsperPage() {
return maxRowsperPage;
}
public void setMaxRowsperPage(int maxRowsperPage) {
this.maxRowsperPage = maxRowsperPage;
}
public int getCurPage() {
return curPage;
}
public void setCurPage(int curPage) {
this.curPage = curPage;
}
public int getTotalPage() {
return totalPage;
}
public void setTotalPage(int totalPage) {
this.totalPage = totalPage;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -