分頁 page

public class Page {
/**
* 當前頁
*/
private Integer currentPage= 1 ;
/**
* 每頁顯示的數量
*/
private Integer pageSize = 3;
/**
* 總條數
*/
private Integer totalCount;
/**
* 總頁數 
*/
private Integer totalPage;
/**
* 當前頁的數據
*/
private List<?> list;
/**
* 訪問servlet的路徑
*/
private String url;

public Integer getCurrentPage() {
return currentPage;
}
public void setCurrentPage(Integer currentPage) {
this.currentPage = currentPage;
}
public Integer getPageSize() {
return pageSize;
}
public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
public Integer getTotalCount() {
return totalCount;
}
public void setTotalCount(Integer totalCount) {
this.totalCount = totalCount;
}
public Integer getTotalPage() {
if(totalCount%pageSize == 0){
totalPage = totalCount/pageSize;
}else {
totalPage = totalCount/pageSize+1;
}
return totalPage;
}
public void setTotalPage(Integer totalPage) {
this.totalPage = totalPage;
}
public List<?> getList() {
return list;
}
public void setList(List<?> list) {
this.list = list;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
}
發佈了48 篇原創文章 · 獲贊 6 · 訪問量 2萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章