封装分页类PageInfo

package com.hc.po;

public class PageInfo {
	
	private int pageIndex=0;//下标
	private int pageSize=3;//页大小
	private int recordCount=0;//总条数;
	private Object data;//分页数据
	public int getPageIndex() {
		return pageIndex;
	}
	public void setPageIndex(int pageIndex) {
		this.pageIndex = pageIndex;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getRecordCount() {
		return recordCount;
	}
	public void setRecordCount(int recordCount) {
		this.recordCount = recordCount;
	}
	public int getPageCount() { //用于获取所有数据总共分为多少页,获取到的总数据出除以每页数据可以直接得到
		return (int)Math.ceil(recordCount/(double)pageSize);
	}

	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}
}

阅读更多
换一批

没有更多推荐了,返回首页