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

Method value

basex-core/src/main/java/org/basex/query/expr/List.java:202–228  ·  view source on GitHub ↗
(final QueryContext qc)

Source from the content-addressed store, hash-verified

200 }
201
202 @Override
203 public Value value(final QueryContext qc) throws QueryException {
204 final Expr[] ex = exprs;
205 Value value = Empty.VALUE;
206 final int el = ex.length;
207 for(int e = 0; e < el;) {
208 value = ex[e++].value(qc);
209 if(value == Empty.VALUE) continue;
210 while(e < el) {
211 final Value value2 = ex[e++].value(qc);
212 if(value2 == Empty.VALUE) continue;
213 while(e < el) {
214 final Value value3 = ex[e++].value(qc);
215 if(value3 == Empty.VALUE) continue;
216 final long size = size();
217 final ValueBuilder vb = new ValueBuilder(qc, size);
218 if(size == -1) vb.tree(value.size() + value2.size() + value3.size() >=
219 Array.INITIAL_CAPACITY ? 1 : Array.INITIAL_CAPACITY);
220 vb.add(value).add(value2).add(value3);
221 while(e < el) vb.add(ex[e++].value(qc));
222 return vb.value(this);
223 }
224 return value.append(value2, qc);
225 }
226 }
227 return value;
228 }
229
230 @Override
231 public Expr simplifyFor(final Simplify mode, final CompileContext cc) throws QueryException {

Callers

nothing calls this directly

Calls 7

sizeMethod · 0.95
treeMethod · 0.95
addMethod · 0.95
valueMethod · 0.95
appendMethod · 0.95
sizeMethod · 0.65
addMethod · 0.65

Tested by

no test coverage detected