page.java
来自「利用javaEE开发而实现图书的购买的一个系统」· Java 代码 · 共 97 行
JAVA
97 行
package org.yangkang.bookshop.util;
public class Page {
private int pagesize = 4;
private int totalpage;
private int currentpage;
private int totalsize;
private int nextpage;
private int previorpage;
private boolean hasfistpage;
private boolean hasnextpage;
private boolean lastpage;
public Page(int currentpage,int totalsize){
this.currentpage = currentpage;
this.totalsize = totalsize;
}
public int getPagesize() {
return pagesize;
}
public void setPagesize(int pagesize) {
this.pagesize = pagesize;
}
public int getTotalpage() {
totalpage = totalsize/pagesize;
if(totalsize%pagesize!=0)
totalpage++;
return totalpage;
}
public void setTotalpage(int totalpage) {
this.totalpage = totalpage;
}
public int getCurrentpage() {
return currentpage;
}
public void setCurrentpage(int currentpage) {
this.currentpage = currentpage;
}
public int getTotalsize() {
return totalsize;
}
public void setTotalsize(int totalsize) {
this.totalsize = totalsize;
}
public int getNextpage() {
nextpage = currentpage+1;
return nextpage;
}
public void setNextpage(int nextpage) {
this.nextpage = nextpage;
}
public int getPreviorpage() {
previorpage = currentpage-1;
return previorpage;
}
public void setPreviorpage(int previorpage) {
this.previorpage = previorpage;
}
public boolean isHasfistpage() {
if(currentpage==1){
hasfistpage = false;
return false;
}
hasfistpage = true;
return hasfistpage;
}
public void setHasfistpage(boolean hasfistpage) {
this.hasfistpage = hasfistpage;
}
public boolean isHasnextpage() {
if(currentpage==totalpage){
hasnextpage = false;
return hasnextpage;
}
hasnextpage = true;
return hasnextpage;
}
public void setHasnextpage(boolean hasnextpage) {
this.hasnextpage = hasnextpage;
}
public boolean isLastpage() {
if(currentpage==totalpage){
lastpage = false;
return lastpage;
}
lastpage = true;
return lastpage;
}
public void setLastpage(boolean lastpage) {
this.lastpage = lastpage;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?