(ParserRuleContext parent, ParseTree child)
| 13 | public class BuffUtils { |
| 14 | |
| 15 | public static int indexOf(ParserRuleContext parent, ParseTree child) { |
| 16 | for (int i = 0; i<parent.getChildCount(); i++) { |
| 17 | if ( parent.getChild(i)==child ) { |
| 18 | return i; |
| 19 | } |
| 20 | } |
| 21 | return -1; |
| 22 | } |
| 23 | |
| 24 | // Generic filtering, mapping, joining that should be in the standard library but aren't |
| 25 | public static <T> T findFirst(List<T> data, Predicate<T> pred) { |
no test coverage detected