(final QueryContext qc)
| 107 | private long spos; |
| 108 | |
| 109 | @Override |
| 110 | public boolean next(final QueryContext qc) throws QueryException { |
| 111 | while(true) { |
| 112 | // find first item |
| 113 | final Item fst = vals != null ? vals[0] : findStart(qc) ? curr : null; |
| 114 | |
| 115 | // find end item |
| 116 | if(fst != null) { |
| 117 | final ValueBuilder vb = new ValueBuilder(qc).add(fst); |
| 118 | final Item[] st = vals == null ? new Item[] { curr, prev, next } : vals; |
| 119 | final long ps = vals == null ? pos : spos; |
| 120 | vals = null; |
| 121 | |
| 122 | while(readNext()) { |
| 123 | if(start.matches(qc, curr, pos, prev, next)) { |
| 124 | vals = new Item[] { curr, prev, next }; |
| 125 | spos = pos; |
| 126 | break; |
| 127 | } |
| 128 | vb.add(curr); |
| 129 | } |
| 130 | |
| 131 | start.bind(qc, st[0], ps, st[1], st[2]); |
| 132 | qc.set(var, vb.value(Window.this)); |
| 133 | return true; |
| 134 | } |
| 135 | |
| 136 | // no more iterations from above, we're done here |
| 137 | if(!prepareNext(qc, sub)) return false; |
| 138 | vals = null; |
| 139 | } |
| 140 | } |
| 141 | }; |
| 142 | } |
| 143 |
no test coverage detected