page.java

来自「这是一个在线办公自动化系统」· Java 代码 · 共 40 行

JAVA
40
字号

package oa.sys;

import java.util.*;
/**
 ****************************************************
 *类名称:	#Page<br>
 *类功能:	分页解决方案<br>
 ****************************************************
*/
public class Page {
	public int curPage;//当前页
	public int maxPage;//最大页
	public int maxRowCount;//最大行
	public int rowsPerPage=5;//每页行
	public Collection coll=null;
	public Page(){
	}
	/***************************************************
	*函数名称:	getCountPage()<br>
	*函数功能:	获取总页数<br>
	*返回值:  	无<br>
	*参数说明:	无<br>
	****************************************************/
	public void getCountPage(){
		if(this.maxRowCount%this.rowsPerPage==0){
			this.maxPage=this.maxRowCount/this.rowsPerPage;
		}else{
			this.maxPage=this.maxRowCount/this.rowsPerPage+1;
		}
	}
	public Collection getResult(){
		return this.coll;
	}
	public Page(Contact contact)throws Exception{
		this.maxRowCount=contact.getCount();
		this.coll=contact.getResult();
	}
}

⌨️ 快捷键说明

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