首页 > 代码库 > page
page
package com.gs.jf.model; import java.io.Serializable; import java.util.ArrayList; import java.util.List; /** * @author liyinlong * * 2017年2月23日下午3:57:34 */ public class Page<T> implements Serializable{ /** * 序列号参数 */ private static final long serialVersionUID = -2680722931433299497L; /** * */ //当前页 private int currentPage; //总页码 private int pageCount; //总条数 private int objectCount=1; //一页容纳条数 private int pageMax = 20; private List<T> list = new ArrayList<T>(); /** * @param currentPage * @param pageMax */ public Page(int currentPage, int pageMax) { super(); this.currentPage = currentPage; this.pageMax = pageMax; } public Page() { } /** * @param currentPage * @param pageCount * @param objectCount * @param pageMax */ public Page(int currentPage, int pageCount, int objectCount, int pageMax) { super(); this.currentPage = currentPage; this.pageCount = pageCount; this.objectCount = objectCount; this.pageMax = pageMax; } /** * @param currentPage * @param pageCount * @param objectCount * @param pageMax * @param list */ public Page(int currentPage, int pageCount, int objectCount, int pageMax, List<T> list) { super(); this.currentPage = currentPage; this.pageCount = pageCount; this.objectCount = objectCount; this.pageMax = pageMax; this.list = list; } public int getcurrentPage() { return currentPage; } public void setcurrentPage(int currentPage) { this.currentPage = currentPage; } public int getPageCount() { pageCount = this.objectCount%this.pageMax==0?this.objectCount/this.pageMax:this.objectCount/this.pageMax+1; return pageCount; } public void setPageCount(int pageCount) { this.pageCount = pageCount; } public int getObjectCount() { return objectCount; } public void setObjectCount(int objectCount) { this.objectCount = objectCount; } public int getPageMax() { return pageMax; } public void setPageMax(int pageMax) { this.pageMax = pageMax; } public List<T> getList() { if(list == null){ return new ArrayList<T>(); } return list; } public void setList(List<T> list) { this.list = list; } @Override public String toString() { return "Page [currentPage=" + this.getcurrentPage() + ", pageCount=" + this.getPageCount() + ", objectCount=" + this.getObjectCount() + ", pageMax=" + pageMax + ", list=" + list + "]"; } }
page
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。