/** * Helper method to extract all matching clauses from an * iterator over rules */ private void checkAll(Iterator<Rule> candidates, TriplePattern goal, List<Rule> matchingRules) { while (candidates.hasNext()) { Rule r = candidates.next(); if ( ((TriplePattern)r.getHeadElement(0)).compatibleWith(goal) ) { matchingRules.add(r); } } }