List of utility methods to do List Select
List | select(List select Iterator<Integer> itIndex = indices.iterator(); if (!itIndex.hasNext()) { return sel; int desiredIndex = itIndex.next().intValue(); int currIndex = 0; for (E elem : list) { if (currIndex == desiredIndex) { ... |
List | select(List select List<T> result = new ArrayList<T>(); for (Integer index : indexes) { result.add(src.get(index)); return result; |
Collection | selectDuplicateQualifiers(List select Duplicate Qualifiers Set<T> result = null; for (T nextQualifier : elements) { if (Collections.frequency(elements, nextQualifier) > 1) { if (result == null) { result = new HashSet<T>(2); result.add(nextQualifier); return (result != null) ? result : Collections.<T>emptySet(); |
List | selectElements(final List select Elements if (list.size() == 0 || !(0 <= start && end < list.size())) return null; final List<String> newList = new ArrayList<String>(); for (int index = start; index <= end; index++) newList.add(String.valueOf(list.get(index))); return newList; |
Collection
| selectExactly(List select Exactly if (nb < 0) { throw new IllegalArgumentException(); if (nb == 0) { return Collections.emptyList(); if (nb == 1) { final List<List<E>> result = new ArrayList<List<E>>(); ... |
String | selectFields(String[] fields, List select Fields String retv = null; int i = 0; StringBuffer sb = null; if (fieldList != null && fieldList.size() > 0) { if (sb == null) { sb = new StringBuffer(); for (Integer index : fieldList) { ... |
T | selectRandom(List select Random int index = (int) (Math.random() * list.size()); return list.get(index); |
ArrayList> | selectTopN(List> originalList, int topN, Comparator Pick the top N items from the specified list. ArrayList<Object> newList = new ArrayList<Object>(topN); int numIncluded = 0; Object lastObject = null; for (Object o : originalList) { if (numIncluded < topN) { newList.add(o); if (comparator.compare(o, lastObject) != 0) { numIncluded++; ... |