List of utility methods to do List Max
int | maxIndex(List Returns the index of the maximum element in the list, using the elements' natural ordering, or -1 if the list is empty. if (list.isEmpty()) return -1; if (list.size() == 1) return 0; int best = 0; for (int i = 1; i < list.size(); ++i) if (list.get(i).compareTo(list.get(best)) > 0) best = i; ... |
int | maxInnerSize(List
Find the maximum size of the inner lists. int result = 0; for (Iterator<List<E>> it = listOfLists.iterator(); it.hasNext();) { List<E> list = it.next(); int size = list.size(); result = (size > result) ? size : result; return result; |
int | maxInt(List max Int if (array.size() == 0) return 0; int res = array.get(0); for (int i = 1; i < array.size(); i++) { res = Math.max(res, array.get(i)); return res; |
int | maxLength(List max Length int len = Integer.MIN_VALUE; for (char[] pattern : patterns) { if (pattern.length > len) { len = pattern.length; return len; |
int | maxLength(List max Length int result = 0; for (String s : list) { result = Math.max(result, s.length()); return result; |
int | maxLength(List max Length int answer = 0; for (String s : strings) { answer = Math.max(answer, s.length()); return answer; |
List | maxList(Iterable Return a List containing all the elements of the specified Iterable that compare as being equal to the maximum element. return maxList(iterable, new Comparator<T>() { public int compare(T o1, T o2) { return o1.compareTo(o2); }); |
int | maxStringLength(List max String Length int l = 0; for (String s : strings) l = Math.max(l, s.length()); return l; |