/**
* 分页工具类
*
* @author vvovv
*
*/
public class PageBean {
private int pageSize; //每页记录数
private int pageCount; //总页数
private int currentPage; //当前页
private int recordCount; //需要分页的记录数
private boolean hasPrivious; //是否有上一页
private boolean hasNext; //是否有下一页
public PageBean(){
this.currentPage = 1;
this.pageSize = 10;
}
public PageBean(int pageSize){
this.currentPage = 1;
this.pageSize = pageSize;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public int getPageCount() {
return pageCount;
}
public void setPageCount(int pageCount) {
this.pageCount = pageCount;
}
public int getCurrentPage() {
return currentPage;
}
public void setCurrentPage(int currentPage) {
this.currentPage = currentPage;
}
public int getRecordCount() {
return recordCount;
}
public void setRecordCount(int recordCount) {
this.recordCount = recordCount;
pageCount = recordCount % pageSize == 0 ? recordCount / pageSize : recordCount / pageSize + 1;
hasPrivious = currentPage == 1 ? false : true;
hasNext = currentPage == pageCount ? false : true;
}
public boolean isHasPrivious() {
return hasPrivious;
}
public void setHasPrivious(boolean hasPrivious) {
this.hasPrivious = hasPrivious;
}
public boolean isHasNext() {
return hasNext;
}
public void setHasNext(boolean hasNext) {
this.hasNext = hasNext;
}
}
分享到:
相关推荐
分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类分页工具类
6-分页工具类1
Page分页java类 Page.getPageIndex(); Page.getPageCount(); Page.getPageSize(); ...
page.java java分页工具类
java分页工具类 java分页工具类 java分页工具类 java分页工具类 java分页工具类 java分页工具类
提供一个可以公用的分页工具类,适用于各种分页
自己简单的做了一个初级分页,可以直接拿去应用,希望有帮助
分页工具类。类似谷歌 百度的分页
spring-sprifengmvc-mybatis中封装的一个分页工具类。方便以后使用,教程地址http://blog.csdn.net/chenyidong521/article/details/68094490
这是一个功能强大,并且易于扩展的分页类,该类将分页的各个元素单独分开模块化,用户可以随心所欲的拼接出自己想要的分页效果,更是添加了控制分页样式的功能,可以让你独立设置分页各元素的样式,也集成了集中已经...
分页工具类 CSS
java实现分页的工具类!对首页、上一页、下一页、尾页包括选择某一页可以轻松实现!
分页工具类、一些常用的分页格式、如常见的文字分页、论坛文字分页、论坛图片分页、
对分页进行了封装,PageUtil.java的分页工具类,自己写了一个dome。
java分页 模糊查询 工具类 page.util,导入里面注释有使用方法,非常好用
自己封装的redis工具类,方便下次使用的时候,直接使用,不用每次去拉去,节省工具使用成本,中心放在实现上。自己使用
通用分页工具类PageInfo.java
java分页工具类,以及基于Struts,Spring,mybatis,jsp中分页的调用及实现
Pager(通过的分页工具类)
java jdbc 分页工具类,以及返回集合数据的封装, private int limit = 10;//每页的个数 /** * 当前页 */ private int page; // /** * 总行数 */ private int totalRows; // /** * 总页数 */ private ...