zoukankan      html  css  js  c++  java
  • Java-分页工具类

    分页工具类

    package com.etc.util;
     
    import java.util.List;
     
    /**分页工具类*/
    public class Page<T> {
         // 总页数
        private int totalPageCount = 1;
        // 页面大小,即每页显示记录数
        private int pageSize = 0;
        // 记录总数
        private int totalCount = 0;
        // 当前页号
        private int currPageNo = 1;
        // 每页数据集合
        private List<T> list;
      
        public List<T> getList() {
            return list;
        }
      
        public void setList(List<T> list) {
            this.list = list;
        }
      
        public int getCurrPageNo() {
            if (totalPageCount == 0)
                return 0;
            return currPageNo;
        }
      
        public void setCurrPageNo(int currPageNo) {
            if (this.currPageNo > 0)
                this.currPageNo = currPageNo;
        }
      
        public int getTotalPageCount() {
            return totalPageCount;
        }
      
        public void setTotalPageCount(int totalPageCount) {
            this.totalPageCount = totalPageCount;
        }
      
        public int getPageSize() {
            return pageSize;
        }
      
        public void setPageSize(int pageSize) {
            if (pageSize > 0)
                this.pageSize = pageSize;
        }
      
        public int getTotalCount() {
            return totalCount;
        }
      
        public void setTotalCount(int totalCount) {
            if (totalCount > 0) {
                this.totalCount = totalCount;
                // 计算总页数
                totalPageCount = this.totalCount % pageSize == 0 ? (this.totalCount / pageSize)
                        : this.totalCount / pageSize + 1;
            }
        }
    }
  • 相关阅读:
    团队冲刺个人总结第二天
    Gym
    Codeforces Round #162 (Div. 2) A~D 题解
    Wormholes 虫洞 BZOJ 1715 spfa判断负环
    修剪草坪 单调队列优化dp BZOJ2442
    没有上司的舞会 树形dp
    餐巾计划问题 费用流
    最小路径覆盖问题 最大流
    [JSOI2007]麻将 模拟 BZOJ1028
    CF702F T-Shirts FHQ Treap
  • 原文地址:https://www.cnblogs.com/peaces/p/14999283.html
Copyright © 2011-2022 走看看