标签:bsp turn stat 个数 param sub style 大小 add
/** * 按指定大小,分隔集合,将集合按规定个数分为n个部分 * * @param list * @param len * @return */ public static <T> List<List<T>> splitList(List<T> list, int len) { if (list == null || list.size() == 0 || len < 1) { return null; } List<List<T>> result = new ArrayList<List<T>>(); int size = list.size(); int count = (size + len - 1) / len; for (int i = 0; i < count; i++) { List<T> subList = list.subList(i * len, ((i + 1) * len > size ? size : len * (i + 1))); result.add(subList); } return result; }
标签:bsp turn stat 个数 param sub style 大小 add
原文地址:https://www.cnblogs.com/zhuzhen/p/9040861.html