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

Method find

basex-core/src/main/java/org/basex/query/func/map/MapFind.java:44–58  ·  view source on GitHub ↗

Finds map entries in the specified iterator. @param iter iterator @param key item to be found @param builder array builder @param qc query context @throws QueryException query exception

(final Iter iter, final Item key, final ArrayBuilder builder,
      final QueryContext qc)

Source from the content-addressed store, hash-verified

42 * @throws QueryException query exception
43 */
44 private static void find(final Iter iter, final Item key, final ArrayBuilder builder,
45 final QueryContext qc) throws QueryException {
46
47 for(Item item; (item = qc.next(iter)) != null;) {
48 if(item instanceof final XQMap map) {
49 final Value value = map.get(key);
50 if(!value.isEmpty()) builder.add(value);
51 map.forEach((k, val) -> find(val.iter(), key, builder, qc));
52 } else if(item instanceof final XQArray array) {
53 for(final Value value : array.members()) {
54 find(value.iter(), key, builder, qc);
55 }
56 }
57 }
58 }
59}

Callers 10

valueMethod · 0.95
valueMethod · 0.45
nextMethod · 0.45
valueMethod · 0.45
testMethod · 0.45
valueMethod · 0.45
itemMethod · 0.45
itemMethod · 0.45
hasMethod · 0.45
valueMethod · 0.45

Calls 8

isEmptyMethod · 0.95
iterMethod · 0.95
nextMethod · 0.65
getMethod · 0.65
addMethod · 0.65
iterMethod · 0.65
forEachMethod · 0.45
membersMethod · 0.45

Tested by

no test coverage detected