| 182 | } |
| 183 | |
| 184 | @Override |
| 185 | public Expr mergeEbv(final Expr ex, final boolean or, final CompileContext cc) |
| 186 | throws QueryException { |
| 187 | |
| 188 | Double newMin = null, newMax = null; |
| 189 | if(ex instanceof final CmpR cmp) { |
| 190 | newMin = cmp.min; |
| 191 | newMax = cmp.max; |
| 192 | } else if(ex instanceof final CmpG cmp && cmp.op == CmpOp.EQ && |
| 193 | ex.arg(1) instanceof final ANum num) { |
| 194 | newMin = num.dbl(); |
| 195 | newMax = newMin; |
| 196 | } |
| 197 | if(newMin == null || !expr.equals(ex.arg(0)) || or && (max < newMin || min > newMax)) |
| 198 | return null; |
| 199 | |
| 200 | // determine common minimum and maximum value |
| 201 | newMin = or ? Math.min(min, newMin) : Math.max(min, newMin); |
| 202 | newMax = or ? Math.max(max, newMax) : Math.min(max, newMax); |
| 203 | return get(cc, info, expr, newMin, newMax); |
| 204 | } |
| 205 | |
| 206 | @Override |
| 207 | public boolean indexAccessible(final IndexInfo ii) throws QueryException { |