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

Method item

basex-core/src/main/java/org/basex/query/func/fn/FnCount.java:22–31  ·  view source on GitHub ↗
(final QueryContext qc, final InputInfo ii)

Source from the content-addressed store, hash-verified

20 */
21public final class FnCount extends StandardFunc {
22 @Override
23 public Itr item(final QueryContext qc, final InputInfo ii) throws QueryException {
24 // iterative access: if the iterator size is unknown, iterate through all results
25 final Iter input = arg(0).iter(qc);
26 long size = input.size();
27 if(size == -1) {
28 do ++size; while(qc.next(input) != null);
29 }
30 return Itr.get(size);
31 }
32
33 @Override
34 protected void simplifyArgs(final CompileContext cc) throws QueryException {

Callers

nothing calls this directly

Calls 5

sizeMethod · 0.95
getMethod · 0.95
iterMethod · 0.65
nextMethod · 0.65
argMethod · 0.45

Tested by

no test coverage detected