分页代码PageBean
时间:2010-07-06 来源:mozhx
package com.jspdev.ch13;
import java.util.Vector;
public class PageBean
{
public int curPage ; //当前是第几页
public int maxPage ; //一共有多少页
public int maxRowCount ; //一共有多少行
public int rowsPerPage=5 ;//每页多少行
public java.util.Vector data;
public PageBean()
{
}
public void countMaxPage() { //根据总行数计算总页数
if (this.maxRowCount % this.rowsPerPage==0){
this.maxPage = this.maxRowCount/this.rowsPerPage;
}else{
this.maxPage = this.maxRowCount/this.rowsPerPage + 1;
}
}
public Vector getResult()
{
return this.data;
}
public PageBean(ContactBean contact)throws Exception
{
this.maxRowCount = contact.getAvailableCount(); //得到总行数
this.data = contact.getResult(); //得到要显示于本页的数据
this.countMaxPage();
}
} //计算总页数
import java.util.Vector;
public class PageBean
{
public int curPage ; //当前是第几页
public int maxPage ; //一共有多少页
public int maxRowCount ; //一共有多少行
public int rowsPerPage=5 ;//每页多少行
public java.util.Vector data;
public PageBean()
{
}
public void countMaxPage() { //根据总行数计算总页数
if (this.maxRowCount % this.rowsPerPage==0){
this.maxPage = this.maxRowCount/this.rowsPerPage;
}else{
this.maxPage = this.maxRowCount/this.rowsPerPage + 1;
}
}
public Vector getResult()
{
return this.data;
}
public PageBean(ContactBean contact)throws Exception
{
this.maxRowCount = contact.getAvailableCount(); //得到总行数
this.data = contact.getResult(); //得到要显示于本页的数据
this.countMaxPage();
}
} //计算总页数
相关阅读 更多 +