Java开发工具有很多, Java分页工具类只是其中之一。
import java.util.List;
/**
- Paging tool
- @author Administrator
*/
public class PageBean {
private int pageNo = 1; //Current page
private int pageSize = 4; //Number of pages per page
private int totalCount; //Total number of records
private int totalPages; //Total pages–read only
private List pageList; //The collection generic type corresponding to each page
public int getPageNo() {
return pageNo;
}
//The current page number cannot be less than 1 and cannot be greater than the total number of pages
public void setPageNo(int pageNo) {
if(pageNo<1)
this.pageNo = 1;
else if(pageNo > totalPages)
this.pageNo = totalPages;
else
this.pageNo = pageNo;
}
public int getPageSize() {
return pageSize;
}
p