PageModel

package com.itsv.yiliao.back.personnel.model;

import java.util.List;
/**
* 分页模型
* @author kingmxj 2009-11-11
*
*/
public class PageModel {

private List list;//存储的数据

private int totalRecords;//总条数

private int pageSize = 10;//每页显示数量

private int pageNo = 1;//页号

private int totalPages;//总页数

private boolean firstPage;//是不是第一页

private boolean lastPage;//是不是最后一页

/**
* 取得首页
* @return
*/
public int getTopPageNo() {
return 1;
}

/**
* 上一页
* @return
*/
public int getPreviousPageNo() {
if (this.pageNo <= 1){
return 1;
}
return this.pageNo - 1;
}

/**
* 下一页
* @return
*/
public int getNextPageNo() {
if (this.pageNo >= this.getBottomPageNo()) {
return this.getBottomPageNo();
}
return this.pageNo + 1;
}

/**
* 尾页
* @return
*/
public int getBottomPageNo() {
return this.getTotalPages();
}

/**
* 总页数
* @return
*/
public int getTotalPages() {
if(this.totalRecords==0){
return 1;
}
return (this.totalRecords + this.pageSize - 1)/this.pageSize;
}

/**
* 是不是首页
* @return
*/
public boolean isFirstPage() {
if(pageNo==1){
return true;
}
return false;
}

/**
* 是不是末页
* @return
*/
public boolean isLastPage() {
if(pageNo==totalPages){
return true;
}
return false;
}

public List getList() {
return list;
}

public void setList(List list) {
this.list = list;
}

public int getTotalRecords() {
return totalRecords;
}

public void setTotalRecords(int totalRecords) {
this.totalRecords = totalRecords;
}

public int getPageSize() {
return pageSize;
}

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

public int getPageNo() {
return pageNo;
}

public void setPageNo(int pageNo) {
this.pageNo = pageNo;
}

public void setTotalPages(int totalPages) {
this.totalPages = totalPages;
}

public void setFirstPage(boolean firstPage) {
this.firstPage = firstPage;
}

public void setLastPage(boolean lastPage) {
this.lastPage = lastPage;
}


}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值