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

Method test

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

Source from the content-addressed store, hash-verified

79 }
80
81 @Override
82 public boolean test(final QueryContext qc, final InputInfo ii, final long pos)
83 throws QueryException {
84 ctxValue(qc);
85
86 final Item min = exprs[0].atomItem(qc, info);
87 if(min == Empty.VALUE) return false;
88
89 final long p = qc.focus.pos;
90 if(exact()) return p == toDouble(min);
91
92 final Item max = exprs[1].atomItem(qc, info);
93 if(max == Empty.VALUE) return false;
94
95 return p >= toDouble(min) && p <= toDouble(max);
96 }
97
98 @Override
99 public Value positions(final QueryContext qc) throws QueryException {

Callers 1

itemMethod · 0.95

Calls 4

exactMethod · 0.95
ctxValueMethod · 0.80
atomItemMethod · 0.45
toDoubleMethod · 0.45

Tested by

no test coverage detected