/**
* 利用subList方法进行分页
*
* @param list 分页数据
* @param pagesize 页面大小
* @param currentPage 当前页面
*/
private List pageBySubList(List list, int pagesize, int currentPage) {
int totalcount = list.size();
int pagecount = 0;
List<String> subList;
int m = totalcount % pagesize;
if (m > 0) {
pagecount = totalcount / pagesize + 1;
} else {
pagecount = totalcount / pagesize;
}
if (m == 0) {
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
} else {
if (currentPage == pagecount) {
subList = list.subList((currentPage - 1) * pagesize, totalcount);
} else {
subList = list.subList((currentPage - 1) * pagesize, pagesize * (currentPage));
}
}
return subList;
}
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。