mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
ContainerUtil.indexOf(list, condition)
This commit is contained in:
@@ -1107,4 +1107,14 @@ public class ContainerUtil {
|
||||
}
|
||||
return to;
|
||||
}
|
||||
|
||||
public static <T> int indexOf(List<T> list, Condition<T> condition) {
|
||||
for (int i = 0, listSize = list.size(); i < listSize; i++) {
|
||||
T t = list.get(i);
|
||||
if (condition.value(t)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user