| 97 | } |
| 98 | |
| 99 | @Override |
| 100 | public boolean test(final QueryContext qc, final InputInfo ii, final long pos) |
| 101 | throws QueryException { |
| 102 | // atomic evaluation of arguments (faster) |
| 103 | if(single) { |
| 104 | final Item item = expr.item(qc, info); |
| 105 | return item != Empty.VALUE && eval(item); |
| 106 | } |
| 107 | |
| 108 | // iterative evaluation |
| 109 | final Iter iter = expr.atomIter(qc, info); |
| 110 | for(Item item; (item = qc.next(iter)) != null;) { |
| 111 | if(eval(item)) return true; |
| 112 | } |
| 113 | return false; |
| 114 | } |
| 115 | |
| 116 | /** |
| 117 | * Evaluates the range for the specified item. |