Java Utililty Methods List IndexOf

List of utility methods to do List IndexOf

Description

The list of methods to do List IndexOf are organized into topic(s).

Method

intindexOfThatStartsWith(List list, String startsWith, int startIndex)
Finds the first string that starts with the given string.
for (int i = startIndex; i < list.size(); i++) {
    String curStr = list.get(i);
    if (curStr != null && curStr.startsWith(startsWith)) {
        return i;
return -1;
intindexOfType(List list, Class type)
index Of Type
for (int idx = 0; idx < list.size(); idx++) {
    if (type.isInstance(list.get(idx))) {
        return idx;
return -1;