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

Method value

basex-core/src/main/java/org/basex/query/func/db/DbGetId.java:22–34  ·  view source on GitHub ↗
(final QueryContext qc)

Source from the content-addressed store, hash-verified

20 */
21public class DbGetId extends DbAccessFn {
22 @Override
23 public final Value value(final QueryContext qc) throws QueryException {
24 final Data data = toData(qc);
25 final Iter values = arg(1).atomIter(qc, info);
26
27 final IntList list = new IntList(Seq.initialCapacity(values.size()));
28 for(Item item; (item = qc.next(values)) != null;) {
29 final int id = (int) toLong(item), pre = pre(id, data);
30 if(pre < 0 || pre >= data.meta.size) throw DB_RANGE_X_X.get(info, data.meta.name, id);
31 list.add(pre);
32 }
33 return DBNodeSeq.get(list.ddo().finish(), data, this);
34 }
35
36 @Override
37 protected final Expr opt(final CompileContext cc) throws QueryException {

Callers

nothing calls this directly

Calls 13

initialCapacityMethod · 0.95
sizeMethod · 0.95
preMethod · 0.95
addMethod · 0.95
getMethod · 0.95
ddoMethod · 0.95
toDataMethod · 0.80
nextMethod · 0.65
getMethod · 0.65
atomIterMethod · 0.45
argMethod · 0.45
toLongMethod · 0.45

Tested by

no test coverage detected