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

Method value

basex-core/src/main/java/org/basex/query/func/map/MapGet.java:18–27  ·  view source on GitHub ↗
(final QueryContext qc)

Source from the content-addressed store, hash-verified

16 */
17public final class MapGet extends MapFn {
18 @Override
19 public Value value(final QueryContext qc) throws QueryException {
20 final XQMap map = toMap(arg(0), qc);
21 final Item key = toAtomItem(arg(1), qc);
22
23 final Value value = map.getOrNull(key);
24 if(value != null) return value;
25 if(defined(2)) return arg(2).value(qc);
26 return Empty.VALUE;
27 }
28
29 @Override
30 protected Expr opt(final CompileContext cc) throws QueryException {

Callers 3

itemMethod · 0.45
itemMethod · 0.45
itemMethod · 0.45

Calls 5

getOrNullMethod · 0.95
toAtomItemMethod · 0.80
definedMethod · 0.80
toMapMethod · 0.45
argMethod · 0.45

Tested by

no test coverage detected