示例#1
0
  /**
   * Binds the specified value to a variable.
   *
   * @param name variable name
   * @param args argument array
   * @param value value to be bound
   * @throws QueryException query exception
   */
  private void bind(final QNm name, final Expr[] args, final Value value) throws QueryException {
    // skip nulled values
    if (value == null) return;

    for (int i = 0; i < function.args.length; i++) {
      final Var var = function.args[i];
      if (!var.name.eq(name)) continue;
      // casts and binds the value
      args[i] = var.checkType(value, context, null);
      break;
    }
  }
示例#2
0
 @Override
 public String toString() {
   final TokenBuilder tb = new TokenBuilder().add(var.toString()).add(' ').add(ASSIGN);
   tb.add(' ').add(expr.toString());
   if (coll != null) tb.add(' ').add(COLLATION).add(" \"").add(coll.uri()).add('"');
   return tb.toString();
 }
示例#3
0
 @Override
 public void plan(final FElem plan) {
   final FElem e = planElem();
   var.plan(e);
   expr.plan(e);
   plan.add(e);
 }
示例#4
0
文件: Count.java 项目: james-jw/basex
 @Override
 public Count optimize(final QueryContext qc, final VarScope scp) throws QueryException {
   var.refineType(SeqType.ITR, qc, info);
   return this;
 }