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

Method value

basex-core/src/main/java/org/basex/query/iter/Iter.java:63–78  ·  view source on GitHub ↗

Returns a value with all iterated items. This method should always be called before single items have been requested. Otherwise, it might not return all items. @param qc query context @param expr original expression (can be null; if assigned, type of result sequence will be refined) @retur

(final QueryContext qc, final Expr expr)

Source from the content-addressed store, hash-verified

61 * @throws QueryException query exception
62 */
63 public Value value(final QueryContext qc, final Expr expr) throws QueryException {
64 // empty sequence?
65 final Item item1 = next();
66 if(item1 == null) return Empty.VALUE;
67
68 // single item?
69 final Item item2 = next();
70 if(item2 == null) return item1;
71
72 // build sequence
73 final ValueBuilder vb = new ValueBuilder(qc, size()).add(item1).add(item2);
74 for(Item item; (item = next()) != null;) {
75 vb.add(item);
76 }
77 return vb.value(expr);
78 }
79}

Callers 11

testMethod · 0.95
testMethod · 0.95
iterMethod · 0.95
valueMethod · 0.95
iterMethod · 0.95
valueMethod · 0.95
iterMethod · 0.95
iterMethod · 0.95
valueMethod · 0.95
iterMethod · 0.95
evalMethod · 0.95

Calls 5

nextMethod · 0.95
sizeMethod · 0.95
addMethod · 0.95
valueMethod · 0.95
addMethod · 0.65

Tested by

no test coverage detected