?? pagesbean.java
字號(hào):
/**
* 作者: 佟勁緯 創(chuàng)建日期: 2006-2-7
*
* QQ: 532443423 Email: TJW_7@163.com
*/
package com.tjw.guestbook.model;
import java.io.*;
/**
*
*/
public class PagesBean implements Serializable {
private int currentPage;
private int totalItem;
private int everyPage;
public void setCurrentPage(int currentPage) {
int totalPage;
totalPage = this.getTotalPage();
if(currentPage <= 0) {
this.currentPage = 0;
return;
} else if(currentPage >= totalPage) {
this.currentPage = totalPage - 1;
return;
}
this.currentPage = currentPage;
}
public int getCurrentPage() {
if(totalItem <= 0) {
return 0;
}
return this.currentPage;
}
public int getCurrentPageNum() {
if(totalItem <= 0) {
return 0;
}
return this.currentPage + 1;
}
public void setEveryPage(int everyPage) {
this.everyPage = everyPage;
}
public int getEveryPage() {
return this.everyPage;
}
public int getTotalPage() {
if(totalItem % everyPage == 0) {
return totalItem / everyPage;
} else {
return totalItem / everyPage + 1;
}
}
public void setTotalItem(int totalItem) {
this.totalItem = totalItem;
}
public int getTotalItem() {
return this.totalItem;
}
public int getBeginPosition() {
return currentPage * everyPage;
}
public int getEndPosition() {
return (currentPage + 1) * everyPage - 1;
}
public boolean isFirstPage() {
return (currentPage <= 0);
}
public boolean isLastPage() {
int totalPage;
totalPage = getTotalPage();
if(currentPage >= totalPage - 1) {
return true;
} else {
return false;
}
}
public boolean isEmptyItem() {
return (totalItem <= 0);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -