版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_32534855/article/details/87854879
代码语言:javascript复制 public List<Record> page(List<Record> dataList, int pageSize,int currentPage) {
List<Record> 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 ) {
Record data = dataList.get(currIdx i);
currentPageList.add(data);
}
}
return currentPageList;
}