复制代码

为懒人提供无限可能,生命不息,code不止

人类感性的情绪,让我们知难行难
我思故我在
日拱一卒,功不唐捐
  • 首页
  • 前端
  • 后台
  • 数据库
  • 运维
  • 资源下载
  • 实用工具
  • 接口文档工具
  • 登录
  • 注册

JAVA代码

【原创】java后台分页PageVO-之一

作者: whooyun发表于: 2017-03-16 01:46

import java.util.List;

public class PageVO {
	/**
	 * 数据总条数
	 */
	public int total;

	/**
	 * 每页显示的条数
	 */
	public int pageSize;

	/**
	 * 数据总页数
	 */
	public int totalPage;

	/**
	 * 当前是第几页
	 */
	public int currentIndex;

	/**
	 * 分页的数据
	 */
	public List<?> dataObj;

	/**
	 * 需要显示的页数
	 */
	public int displayNum = 5; // 显示的页数

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public void setCurrentIndex(int currentIndex) {
		this.currentIndex = currentIndex;
	}

	public int getDisplayNum() {
		return displayNum;
	}

	public void setDisplayNum(int displayNum) {
		this.displayNum = displayNum;
	}

	public int getCurrentIndex() {
		return currentIndex;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getPageSize() {
		return pageSize;
	}

	public int getTotalPage() {
		return (this.total + this.pageSize - 1) / this.pageSize;
	}

	public List<?> getDataObj() {
		return dataObj;
	}

	public void setDataObj(List<?> dataObj) {
		this.dataObj = dataObj;
	}

	/**
	 * @return the total
	 */
	public int getTotal() {
		return total;
	}

	/**
	 * @param total
	 *            the total to set
	 */
	public void setTotal(int total) {
		this.total = total;
	}

}