码迷,mamicode.com
首页 > 其他好文 > 详细

page

时间:2017-03-06 12:27:32      阅读:171      评论:0      收藏:0      [点我收藏+]

标签:UI   version   uid   auth   err   mod   pac   final   current   

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

标签:UI   version   uid   auth   err   mod   pac   final   current   

原文地址:http://www.cnblogs.com/hy87/p/6508778.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!