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

Method test

basex-core/src/main/java/org/basex/query/expr/CmpRangeG.java:29–40  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii, final long pos)

Source from the content-addressed store, hash-verified

27 }
28
29 @Override
30 public boolean test(final QueryContext qc, final InputInfo ii, final long pos)
31 throws QueryException {
32 final RangeSeq rs = (RangeSeq) exprs[1].value(qc);
33 final long min = rs.min(), max = rs.max();
34 final Iter iter = exprs[0].atomIter(qc, info);
35 for(Item item; (item = qc.next(iter)) != null;) {
36 final double value = item.dbl(info);
37 if(value >= min && value <= max && value == (long) value) return true;
38 }
39 return false;
40 }
41
42 @Override
43 public CmpG copy(final CompileContext cc, final IntObjectMap<Var> vm) {

Callers

nothing calls this directly

Calls 6

minMethod · 0.95
maxMethod · 0.95
dblMethod · 0.95
nextMethod · 0.65
valueMethod · 0.45
atomIterMethod · 0.45

Tested by

no test coverage detected