Returns slice properties. @param size input size @param qc query context @return slice properties @throws QueryException query exception
(final long size, final QueryContext qc)
| 78 | * @throws QueryException query exception |
| 79 | */ |
| 80 | protected final Slice slice(final long size, final QueryContext qc) throws QueryException { |
| 81 | Slice s = new Slice(size, toLong(1, 0, qc), toLong(2, 0, qc), toLong(3, 0, qc), false); |
| 82 | if(s.step < 0) s = new Slice(size, -s.start, -s.end, -s.step, true); |
| 83 | s.start = Math.max(1, s.start); |
| 84 | s.end = Math.min(size, s.end); |
| 85 | s.length = s.end < 1 || s.start > size || s.start > s.end ? 0 : s.end - s.start + 1; |
| 86 | return s; |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Returns a normalized specified integer argument. |