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

Method eval

basex-core/src/main/java/org/basex/query/expr/CmpSR.java:122–129  ·  view source on GitHub ↗

Evaluates the range for the specified item. @param item item to be evaluated @return result of check @throws QueryException query exception

(final Item item)

Source from the content-addressed store, hash-verified

120 * @throws QueryException query exception
121 */
122 private boolean eval(final Item item) throws QueryException {
123 if(!item.type.isStringOrUntyped()) throw compareError(item, Str.EMPTY, info);
124 final byte[] s = item.string(info);
125 final Collation coll = sc().collation;
126 final int mn = min == null ? 1 : Token.compare(s, min, coll);
127 final int mx = max == null ? -1 : Token.compare(s, max, coll);
128 return (mni ? mn >= 0 : mn > 0) && (mxi ? mx <= 0 : mx < 0);
129 }
130
131 @Override
132 public Expr mergeEbv(final Expr ex, final boolean or, final CompileContext cc)

Callers 1

testMethod · 0.95

Calls 5

compareMethod · 0.95
compareErrorMethod · 0.80
isStringOrUntypedMethod · 0.65
stringMethod · 0.45
scMethod · 0.45

Tested by

no test coverage detected