最好用的分页代码(java版)(7)
发布时间:2021-06-05
发布时间:2021-06-05
public int getLastPageCount() { int lastpagesize = 0; if (size % pageSize == 0) { lastpagesize = pageSize; } else { lastpagesize = size % pageSize; } return lastpagesize; } // 设置显示的记录列表 private void setShowList(List list) { ("$$totalSize=" + this.size + "; curPageNo=" + this.curPageNo + "; pageSize=" + this.pageSize + "; groupSize=" + this.groupSize); if (list == null) { list = new ArrayList(); } if (pageSize >= list.size()) { this.showList = list; } else { if (groupSize <= 1) { groupSize = 1; if (pageSize * (curPageNo + 1) > list.size()) { if (pageSize * curPageNo > list.size()) { this.showList = list.subList(list.size() - pageSize, list.size());// 返回最后一页的数据 } else { this.showList = list.subList(pageSize * curPageNo, list .size()); } } else { this.showList = list.subList(pageSize * curPageNo, pageSize * (curPageNo + 1)); } } else { if (pageSize * ((curPageNo % groupSize) + 1) > list.size()) { this.showList = list.subList(pageSize * (curPageNo % groupSize), list.size()); } else { this.showList = list.subList(pageSize * (curPageNo % groupSize), pageSize * ((curPageNo % groupSize) + 1)); }
上一篇:四级完形精选练习及答案(26)
下一篇:桑黄胞外多糖药理活性的初步研究