List of utility methods to do List Sub List
List
| split(List Partition from into subLists, each of size subListSize. List<List<T>> into = new ArrayList<List<T>>(); for (int first = 0; first < from.size(); first += subListSize) { into.add(from.subList(first, Math.min(first + subListSize, from.size()))); return into; |
List
| splitIntoSubListsByNumber(final List split Into Sub Lists By Number final int sizeOfSublists = (int) Math.ceil((double) list.size() / (double) numberOfSublists); return splitIntoSubListsBySize(list, sizeOfSublists); |
List
| splitList(List Methode permettant de splitter une liste en un certain nombre de sous-listes List<List<T>> splitted = new ArrayList<List<T>>(); if (list == null || list.size() == 0) return splitted; int listSize = list.size(); int subSize = Math.max(listSize / (subListNumber - 1), 1); for (int i = 0; i < listSize; i += subSize) { splitted.add(new ArrayList<T>(list.subList(i, Math.min(listSize, i + subSize)))); return splitted; |
List
| splitListToSubLists(List split List To Sub Lists List<List<T>> subLists = new ArrayList<List<T>>(); if (subListSize > parentList.size()) { subLists.add(parentList); } else { int remainingElements = parentList.size(); int startIndex = 0; int endIndex = subListSize; do { ... |
boolean | startsWith(final List extends T> list, final List extends T> subList) Does a list start with a sub-list. if ((list == null) || (subList == null) || (list.size() < subList.size())) { return false; return list.subList(0, subList.size()).equals(subList); |
List | sub(List sub List<T> subL = new ArrayList<>(l); subL.remove(index); return subL; |
boolean | subArray(List Sub array. if (isEmpty(listA) && !isEmpty(listB)) { return false; if (!isEmpty(listA) && isEmpty(listB)) { return false; if (isSizeZero(listA) && isSizeZero(listB)) { return true; ... |
List | subList(final Iterable parent, final Iterable Create sublist view of child from element on [size-of-parent] position to last element. Iterator<P> iParent = parent.iterator(); List<C> result = new ArrayList<>(); for (C arg : child) { if (iParent.hasNext()) { iParent.next(); } else { result.add(arg); if (iParent.hasNext()) { throw new IllegalArgumentException("Parent argument is bigger than child."); return result; |
List | subList(final List Copies the elements at the indexes positions List<E> list = new ArrayList<E>(indexes.length); for (int index : indexes) { if (index >= 0 && index < oriList.size()) { list.add(oriList.get(index)); return list; |
List | subList(final List a sublist implementation that is diffrent from List#subList(int,int) as it handles out of bounds indexes gracefully if (list.size() < first) { return new ArrayList<T>(0); return list.subList(first, Math.min(first + count, list.size())); |