1. 程式人生 > >Java List分頁

Java List分頁

number als enum arraylist size imp ges nal dto

List<TerminalStoreRepeatDto> pageNewData=new ArrayList<>();
int currIdx = (page.getPageNumber() > 0 ? page.getPageNumber() * page.getPageSize() : 0);
for (int i = 0; i < page.getPageSize() && i < terminalStoreRepeatDtoList.size() - currIdx; i++) {
TerminalStoreRepeatDto terminalStoreRepeatDto = terminalStoreRepeatDtoList.get(currIdx + i);
pageNewData.add(terminalStoreRepeatDto);
}
PageImpl<TerminalStoreRepeatDto> pageData = new PageImpl<TerminalStoreRepeatDto>(pageNewData,page,terminalStoreRepeatDtoList.size());

Java List分頁