package cn.bdqn.mhouse.util;import java.util.ArrayList;
import java.util.List;import cn.bdqn.mhouse.entity.House;/***
*
* 项目名称:mhouse
* 类名称:Page
* 类描述: 分页的工具类
* 创建人:Mu Xiongxiong
* 创建时间:2017-3-17 下午1:04:02
* 修改人:Mu Xiongxiong
* 修改时间:2017-3-17 下午1:04:02
* 修改备注:
* @version
**/
public class Page {private int pageSize=3; //页大小private int pageIndex=0; //当前页号private int totalPageCount=0; //总页数private int record=0; //记录总数private Integer nextPage; //下一页private Integer prePage; //上一页private List<House> houseList=new ArrayList<House>(); //房屋信息的集合/** * @author Mu Xiongxiong * @created 2017-3-17 下午10:04:41 * @return type */public List<House> getHouseList() {return houseList;}/** * @author Mu Xiongxiong * @created 2017-3-17 下午10:04:41 * @param houseList */public void setHouseList(List<House> houseList) {this.houseList = houseList;}//得到开始记录数public int getSartRow(){return (pageIndex-1)*pageSize;}//得到结束记录数public int getEndRow(){return pageSize;}public int getPageSize() {return pageSize;}public void setPageSize(int pageSize) {this.pageSize = pageSize;}public int getPageIndex() {return pageIndex;}//得到当前页public void setPageIndex(int pageIndex) {this.pageIndex = pageIndex;//下一页setNextPage();//上一页setPrePage();}public int getTotalPageCount() {return totalPageCount;}//总页数public void setTotalPageCount() {int totalP = record % getPageSize() == 0 ? record / getPageSize() :record/ getPageSize() + 1;this.totalPageCount = totalP;}public int getRecord() {return record;}//总记录数public void setRecord(int record) {this.record = record;//设置总页数setTotalPageCount();}public Integer getNextPage() {return nextPage;}//设置下一页public void setNextPage() {this.nextPage = this.pageIndex+1;}public Integer getPrePage() {return prePage;}//设置上一页public void setPrePage() {this.prePage =this.pageIndex-1;if(this.prePage<1){this.prePage=1;}}}