首页>代码>javabean+servlet+jsp开发商品后台管理系统(源码+数据库脚本)>/JavaWebProject_v1.0/src/com/yueqian/project/bean/PageBean.java
package com.yueqian.project.bean;

/**
 * @ClassName: PageBean
 * @Description:��ҳʵ����
 * ע�⣺���ݵIJ���ֻ�������
 *      totalCount:����Ŀ��
 *      pageSize:ÿһҳ��ʾ������
 *      currentPage:��ǰҳ
 *      �����ڲ�����
 * @author: ����ʦ   QQ:2506075234
 * @date: 2021��3��23�� ����8:31:17
 *
 * @Copyright: 2021 www.gec-edu.org Inc. All rights reserved.
 *
 */
public class PageBean {
    private int totalCount;  //����Ŀ��
    private int pageSize = 4;  //ÿһҳ��ʾ������
    private int totalPage;  //��ҳ��
    private int currentPage;  //��ǰҳ��ҳ��
    private boolean isFirstPage;  //�Ƿ���ҳ
    private boolean isLastPage;  //�Ƿ�βҳ
    private int prePage;  //�ص���һҳ
    private int nextPage;  //�ص���һҳ
    private int startIndex;//��ʼ����
    private int[] pageCount = new int[5];//��̬��ҳ������
	public PageBean() {
		super();
	}

	public PageBean(int pageSize, int currentPage,int totalCount) {
		super();
		this.pageSize = pageSize;
		this.currentPage = currentPage;
		this.totalCount = totalCount;
		// ������ҳ��
		this.totalPage =(totalCount%pageSize==0?0:1)+totalCount/pageSize;
		// ���õ�ǰ����
		this.startIndex = (currentPage-1)*pageSize;
		// ��֤�Ƿ�����ҳ
		this.isFirstPage = currentPage==1?true:false;
		// ��֤�Ƿ���βҳ
		this.isLastPage = currentPage==totalPage?true:false;
		// ������һҳ
		int currPre = currentPage;
		this.prePage = isFirstPage?currentPage:--currPre;// ���ﲻ��ֱ��ʹ��currentPage���㣬�����Ӱ�쵽��һҳ�ļ���
		// ������һҳ
		int currNext = currentPage;
		this.nextPage = isLastPage?currentPage:++currNext;
		
	}

	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getPageSize() {
		return pageSize;
	}

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

	public int getTotalPage() {
		return totalPage;
	}
	/**
	 * @Title: setTotalPage
	 * @Description: ���ü�����ҳ��
	 * @param: totalPage
	 * @return: void
	 */
	public void setTotalPage(int totalPage) {
		this.totalPage =(totalCount%pageSize==0?0:1)+totalCount/pageSize;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public boolean isFirstPage() {
		return isFirstPage;
	}
	/**
	 * @Title: setFirstPage
	 * @Description: ��֤�Ƿ�����ҳ
	 * @param: isFirstPage
	 * @return: void
	 */
	public void setFirstPage(boolean isFirstPage) {
		this.isFirstPage = currentPage==1?true:false;
	}
	public boolean isLastPage() {
		return isLastPage;
	}
	/**
	 * @Title: setLastPage
	 * @Description: ��֤�Ƿ���βҳ
	 * @param: isLastPage
	 * @return: void
	 */
	public void setLastPage(boolean isLastPage) {
		this.isLastPage = currentPage==totalPage?true:false;
	}
	public int getPrePage() {
		return prePage;
	}
	/**
	 * @Title: setPrePage
	 * @Description: ������һҳ
	 * @param: prePage
	 * @return: void
	 */
	public void setPrePage(int prePage) {
		this.prePage = isFirstPage?currentPage:--currentPage;
	}
	public int getNextPage() {
		return nextPage;
	}
	/**
	 * @Title: setNextPage
	 * @Description: ������һҳ
	 * @param: nextPage
	 * @return: void
	 */
	public void setNextPage(int nextPage) {
		this.nextPage = isLastPage?currentPage:++currentPage;
	}
	public int getStartIndex() {
		return startIndex;
	}
	/**
	 * @Title: setStartIndex
	 * @Description: ���õ�ǰ����
	 * @param: startIndex
	 * @return: void
	 */
	public void setStartIndex(int startIndex) {
		this.startIndex = (currentPage-1)*pageSize;
	}



    

}
最近下载更多
15532048877  LV1 6月19日
穿山甲1001  LV6 2024年9月7日
TY0165  LV20 2024年6月18日
aholian  LV2 2024年6月13日
HangEcho  LV2 2024年6月5日
sz1111111  LV2 2024年3月26日
PSSDZH  LV3 2024年1月22日
aaasue  LV1 2024年1月4日
luoqingyun  LV1 2023年12月31日
最近浏览更多
暂无贡献等级
15532048877  LV1 6月19日
blzzza 6月16日
暂无贡献等级
暂无贡献等级
wmmmmmm 6月14日
暂无贡献等级
歪比歪比 5月27日
暂无贡献等级
luoyun123 5月11日
暂无贡献等级
wwy000  LV2 4月29日
1138504729 4月13日
暂无贡献等级
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友