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

Method sum

basex-core/src/main/java/org/basex/query/var/VarUsage.java:52–59  ·  view source on GitHub ↗

Checks how often a variable or context reference is accessed in all given expressions. @param var variable (Var reference) or context (null) to inline @param exprs expressions @return number of accesses to the variable in all expressions combined

(final Var var, final Expr... exprs)

Source from the content-addressed store, hash-verified

50 * @return number of accesses to the variable in all expressions combined
51 */
52 public static VarUsage sum(final Var var, final Expr... exprs) {
53 VarUsage uses = NEVER;
54 for(final Expr expr : exprs) {
55 uses = uses.plus(expr.count(var));
56 if(uses == MORE_THAN_ONCE) break;
57 }
58 return uses;
59 }
60
61 /**
62 * Checks how often a variable or context reference is used in any of the given expressions.

Callers 8

countMethod · 0.95
countMethod · 0.95
countMethod · 0.95
countMethod · 0.95
countMethod · 0.95
countMethod · 0.95
countMethod · 0.95
countMethod · 0.95

Calls 2

plusMethod · 0.95
countMethod · 0.65

Tested by

no test coverage detected