pagebean.java

来自「spring+webwork+iBatis做的VOD系统web端代码。值得学习M」· Java 代码 · 共 62 行

JAVA
62
字号
package com.hintsoft.vod.entities;

import java.util.Collection;

public class PageBean {
	private int recordPage = 2;

	private int currentPage = 1;

	private int totalPage;

	private int totalRecord;

	private Collection data;

	public int getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}

	public Collection getData() {
		return data;
	}

	public void setData(Collection data) {
		this.data = data;
	}

	public int getRecordPage() {
		return recordPage;
	}

	public void setRecordPage(int recordPage) {
		this.recordPage = recordPage;
	}

	public int getTotalPage() {
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public int getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(int totalRecord) {
		this.totalRecord = totalRecord;
		process();
	}

	private void process() {
		totalPage = (totalRecord % recordPage == 0) ? (totalRecord / recordPage)
				: (totalRecord / recordPage) + 1;
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?