Exemple #1
0
 public static <T> int lastIndexOf(List<? extends T> elems, Filter<T> filter) {
   for (int i = elems.size() - 1; i >= 0; i--) {
     if (filter.select(elems.get(i))) return i;
   }
   return -1;
 }
Exemple #2
0
 public static <T> int indexOf(List<? extends T> elems, Filter<T> filter) {
   for (int i = 0; i < elems.size(); i++) {
     if (filter.select(elems.get(i))) return i;
   }
   return -1;
 }