示例#1
0
文件: Utils.java 项目: dxhj/antlr4
 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;
 }
示例#2
0
文件: Utils.java 项目: dxhj/antlr4
 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;
 }