public class ListSub{ /** * 当前页面 */ private int page = 1; /** * 显示多少行 */ private int rows = 15; /** * 总记录条数 */ private int total; /** * @return the page */ public int getPage() { return page; } /** * @param page the page to set */ public void setPage(int page) { this.page = page; } /** * @return the rows */ public int getRows() { return rows; } /** * @param rows the rows to set */ public void setRows(int rows) { this.rows = rows; } /** * @return the total */ public int getTotal() { return total; } /** * @param total the total to set */ public void setTotal(int total) { this.total = total; } /** * 对list集合进行分页处理 * * @return */ private List<E> ListSplit(List<E> list) { List<E> newList=null; total=list.size(); newList=list.subList(rows*(page-1), ((rows*page)>total?total:(rows*page))); return newList; } }
版权声明:本文为zhouhua0104原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。