import java.***.arraylist;
import java.***.list;
/** * 通用分页工具类,该工具类分页指定泛型的List对集合 * * @author evan * @time 2010-01-12 * @param
/** * 总记录数 */ private int total /** * 分页切割的启始点 */ private int startIndex;
/** * 分页切割的结束点 */ private i /** * 总页数 */ prive;
/** * 当前页数 */ private int curr /** * 总记录集合 */ private List
public Page(List
***.totallist = totalList;
innit();
} /** * 初始化该分页对象 */ privat { if (null !
= { totalRecord = ***.size( if (totalRecord % ***.pagerecords == 0) { ***.totalpage = totalRepagerecords } else { ***.totalpage = totalRecord / ***.pagerecords + 1;
} } } /** * 得到分页后的数据 * * @return 分页数据 */ pubtPage(int curren { ***.currentpage = currentPa if (currentPage <= 0) { ***.currentpage = 1;
} if (currentPage >= ***.totalpage) { ***.currentpage = ***.totalpage;
} List
if (null !
= ***.totallist) { ***.addall(this.***.sublist(getStartIndex(), getEndIndex()));
} return subList;
} /** * 设置每页显示的记录条数,如果不设置则默认为每页显示30条记录 * * @param pageRecords * 每页显示的记录条数(值必需介于10~100之间) */ public void setPageRecords(int pageRecords) { if (pageRecords >= 10 && pageRecords <= 100) { ***.pagerecords = pageRecords;
innit();
} } public int getStartIndex() { if (null == ***.totallist) { return 0;
} ***.startindex = (getCurrentPage() - 1) * ***.pagerecords;
if (startIndex > totalRecord) { startIndex = totalRecord;
} if (startIndex < 0) { startIndex = 0;
} return startIndex;
} public int getEndIndex() { if (null == ***.totallist) { return 0;
} endIndex = getStartIndex() + ***.pagerecords;
if (endIndex < 0) { endIndex = 0;
} if (endIndex < getStartIndex()) { endIndex = getStartIndex();
} if (endIndex > ***.totalrecord) { endIndex = ***.totalrecord;
} return endIndex;
} /*** * 获取总页数 * @return */ public int getTotalPage() { return totalPage;
} /** * 获取List集合中的总条数 * @return */ public int getTotalRecord() { return totalRecord;
} public boolean isEndPage() { return ***.currentpage == ***.totalpage;
} /** * 获取下一页的页数 * * @return 下一页的页数 */ public int getNextPage() { int nextPage = ***.currentpage + 1;
if (nextPage > ***.totalpage) { nextPage = ***.totalpage;
} if (nextPage <= 0) { nextPage = 1;
} return nextPage;
} /** * 获取上一页的页数 * * @return 上一页的页数 */ public int getPrivyPage() { int privyPage = ***.currentpage - 1;
if (privyPage > ***.totalpage) { privyPage = ***.totalpage;
} if (privyPage <= 0) { privyPage = 1;
} return privyPage;
} /** * 获取当前页页数 * @return */ public int getCurrentPage() { return currentPage;
} 内容来自网友回答
例如集合Cua就是全集合中没有A元素的其他元素的集合,那么Cra是什么意思呀?题目是这样的:设A={(xI1