/**
* 循环截取某页列表进行分页
* @param dataList 分页数据
* @param pageSize 页面大小
* @param currentPage 当前页面
*/
public static List<String> page(List<String> dataList, int pageSize,int currentPage) {
List<String> currentPageList = new ArrayList<>();
if (dataList != null && dataList.size() > 0) {
int currIdx = (currentPage > 1 ? (currentPage - 1) * pageSize : 0);
for (int i = 0; i < pageSize && i < dataList.size() - currIdx; i++) {
String data = dataList.get(currIdx + i);
currentPageList.add(data);
}
}
return currentPageList;
}
11-02
223
10-18
6635
07-31
2726