List of utility methods to do List IndexOf
int | indexOfId(List aList, Object anObj) Returns index of identical given object in given list. for (int i = 0, iMax = size(aList); i < iMax; i++) if (anObj == aList.get(i)) return i; return -1; |
int | indexOfIdentical(List list, Object value) Returns the index in list of the first occurrence identical to value , or -1 if list does not contain value . int i = 0; for (Object element : list) { if (element == value) { return i; ++i; return -1; ... |
int | indexOfIdentity(List index Of Identity for (int i = 0; i < l.size(); i++) { if (l.get(i) == t) return i; return -1; |
int | indexOfIgnoreCase(List index Of Ignore Case for (int i = 0; i < values.size(); i++) { if (values.get(i).equalsIgnoreCase(target)) { return i; return -1; |
int | indexOfInstance(List> list, Object object) Performs a lookup for the exact instance of an object in the list and returns its index, or -1 if not found. for (int i = 0; i < list.size(); i++) { if (list.get(i) == object) { return i; return -1; |
int | indexOfInstance(List Finds the index of the first element in the given list of the given type. int k = 0; for (T t : list) { if (type.isInstance(t)) { return k; k++; return -1; ... |
int | indexOfMax(List list) index Of Max return list.indexOf(Collections.max(list));
|
int | indexOfMax(List Finds the first index of a maximal element in a list. T min = list.get(0); int index = 0; for (int i = 0, n = list.size(); i < n; i++) { T value = list.get(i); if (value.compareTo(min) > 0) { min = value; index = i; return index; |
int | indexOfMinSize(final List index Of Min Size if (sets.isEmpty()) throw new IllegalArgumentException("empty sets"); int res = 0; for (int i = 1; i < sets.size(); i++) { if (sets.get(i).size() < sets.get(res).size()) res = i; return res; ... |
int | indexOfNull(List Returns the index of the first null element within the given List . int retval = -1; if (list != null) { retval = list.indexOf(null); return retval; |