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

Method test

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

Source from the content-addressed store, hash-verified

172 }
173
174 @Override
175 public boolean test(final QueryContext qc, final InputInfo ii, final long pos)
176 throws QueryException {
177 ctxValue(qc);
178
179 final Value value = expr.value(qc);
180 if(value == Empty.VALUE) return false;
181
182 final long p = qc.focus.pos, vs = value.size();
183 final double min = toDouble(value.itemAt(0));
184 final double max = vs == 1 ? min : toDouble(value.itemAt(vs - 1));
185 return p >= min && p <= max;
186 }
187
188 @Override
189 public Pos copy(final CompileContext cc, final IntObjectMap<Var> vm) {

Callers 1

itemMethod · 0.95

Calls 5

itemAtMethod · 0.95
ctxValueMethod · 0.80
sizeMethod · 0.65
valueMethod · 0.45
toDoubleMethod · 0.45

Tested by

no test coverage detected