| 74 | } |
| 75 | |
| 76 | public static String[] testFilters (FilterFunc filter, Tuple[] tuples) { |
| 77 | List<String> res = new ArrayList<String>(); |
| 78 | try { |
| 79 | for (Tuple t : tuples) { |
| 80 | if (filter.exec(t)) { |
| 81 | System.out.println("accepted: " + t); |
| 82 | res.add((String)t.get(0)); |
| 83 | } else { |
| 84 | System.out.println("rejected: " + t); |
| 85 | } |
| 86 | } |
| 87 | } catch (Exception e) { |
| 88 | e.printStackTrace(); |
| 89 | System.exit(1); |
| 90 | } |
| 91 | |
| 92 | System.out.println("==="); |
| 93 | return res.toArray(new String[res.size()]); |
| 94 | } |
| 95 | |
| 96 | public static void main(String[] args) { |
| 97 | String[] queries = { |