int pageSize = 4;
int total = splist.size();
int pageCount = total % pageSize == 0 ? total / pageSize : total / pageSize + 1;
for(int i = 0; i < pageCount; i++) {
Map<Integer,List<MxxzWebsitComment>> tmpMap =new HashMap();
int start = i * pageSize;
int end = start + pageSize > total ? total : start + pageSize;
List<MxxzWebsitComment> subList = splist.subList(start, end);
tmpMap.put(i, subList);
tmpList.add(tmpMap);
}
|
|