📄 readbymultipage.java
字号:
package com.x3408.office;
import java.util.Vector;
public class ReadByMultipage {
private Vector list=null;
private int pageSize=0;
private int recordCount=0;
private int pageCount=0;
private int showPage=0;
public ReadByMultipage(Vector pList,int pPageSize){
if(pList==null||pList.size()<1)return;
list=pList;
pageSize=pPageSize;
recordCount=list.size();
pageCount=recordCount%pageSize==0?recordCount/pageSize:recordCount/pageSize+1;
}
public Vector getPage(String pShowPage){
Vector<Object> listPage=null;
if(list==null||list.size()<1)return null;
listPage=new Vector<Object>();
showPage=pShowPage==null?1:Integer.parseInt(pShowPage);
if(showPage<1){
showPage=1;
}else if(showPage>pageCount){
showPage=pageCount;
}
for(int i=(showPage-1)*pageSize;i<showPage*pageSize&&i<recordCount;i++){
listPage.addElement(list.elementAt(i));
}
return listPage;
}
public String getShowPage(){
return String.valueOf(showPage);
}
public String getPageCount(){
return String.valueOf(pageCount);
}
public String getRecordCount(){
return String.valueOf(recordCount);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -