MCPcopy Create free account
hub / github.com/BaseXdb/basex / mergeEbv

Method mergeEbv

basex-core/src/main/java/org/basex/query/expr/CmpR.java:184–204  ·  view source on GitHub ↗
(final Expr ex, final boolean or, final CompileContext cc)

Source from the content-addressed store, hash-verified

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 {

Callers

nothing calls this directly

Calls 6

getMethod · 0.95
argMethod · 0.45
dblMethod · 0.45
equalsMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected