📄 pageturner.java
字号:
package com.buat.pageturner;
public class PageTurner {
private int total = 0;
private int countperPage = 0;
private int pageNO = 0;
private int pageCount = 0;
private int beginIndex = 0;
private int endIndex = 0;
public int getTotal() {
return total;
}
public void setTotal(int total) {
this.total = total;
}
public int getCountperPage() {
return countperPage;
}
public void setCountperPage(int countperPage) {
this.countperPage = countperPage;
}
public int getPageNO() {
if (this.pageNO < 0) {
this.pageNO = 0;
}
if (this.pageNO > this.pageCount) {
this.pageNO = this.pageCount;
}
return pageNO;
}
public void setPageNO(int pageNO) {
this.pageNO = pageNO;
}
public int getBeginIndex() {
this.beginIndex = this.pageNO * this.countperPage;
return beginIndex;
}
public void setBeginIndex(int beginIndex) {
this.beginIndex = beginIndex;
}
public int getEndIndex() {
if (this.pageNO > this.pageCount - 1) {
this.endIndex = this.total - 1;
} else {
this.endIndex = (this.pageNO + 1) * this.countperPage - 1;
}
return endIndex;
}
public void setEndIndex(int endIndex) {
this.endIndex = endIndex;
}
public int getPageCount() {
this.pageCount = (this.total - 1) / this.countperPage + 1;
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public PageTurner(int total, int countperPage) {
super();
this.total = total;
this.countperPage = countperPage;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -