java分页实体类PageBean

package com.wym.domain;
/**
 * 分页Bean
 * @author 翁艳敏
 *
 */
public class PageBean {
    
    
	private Integer  startIndex; 
	private Integer currentPage;
	private Integer pageSize=5;
	private Integer totalCount;//总行数
	private Integer totalPage;//总页面
	
	public Integer getStartIndex() {
    
    
		return startIndex;
	}
	public void setStartIndex(Integer startIndex) {
    
    
		this.startIndex = startIndex;
	}
	public Integer getCurrentPage() {
    
    
		return currentPage;
	}
	public void setCurrentPage(Integer currentPage) {
    
    
		this.currentPage = currentPage;
		this.startIndex=(this.currentPage-1)*this.pageSize;
	}
	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;
		//计算总页数
		this.totalPage=(int)(Math.ceil(this.totalCount*1.0/this.pageSize));
	}
	public Integer getTotalPage() {
    
    
		return totalPage;
	}
	public void setTotalPage(Integer totalPage) {
    
    
		this.totalPage = totalPage;
	}
	
}

猜你喜欢

转载自blog.csdn.net/weng74/article/details/107609770