protected ExprFunctionN(String fName, Expr... args) { this(fName, argList(args)) ; }
@Override final public NodeValue eval(Binding binding, FunctionEnv env) { NodeValue s = evalSpecial(binding, env) ; if ( s != null ) return s ; List<NodeValue> argsEval = new ArrayList<NodeValue>() ; for ( int i = 1 ; i <= numArgs() ; i++ ) { NodeValue x = eval(binding, env, getArg(i)) ; argsEval.add(x) ; } return eval(argsEval, env) ; }
@Override public NodeValue evalSpecial(Binding binding, FunctionEnv env) { for ( Expr expr : super.getArgs() ) { try { NodeValue nv = expr.eval(binding, env) ; return nv ; } catch (ExprEvalException ex) {} } throw new ExprEvalException("COALESCE: no value") ; }
protected abstract NodeValue eval(List<NodeValue> args) ;
@Override public Expr transform(ExprFunctionN func, ExprList args) { ExprFunction f = func.getFunction(); if (this.shouldExpand(f)) { UserDefinedFunctionDefinition def = this.definitions.get(f.getFunction().getFunctionIRI());
@Override public NodeValue evalSpecial(Binding binding, FunctionEnv env) { for ( Expr expr : super.getArgs() ) { try { NodeValue nv = expr.eval(binding, env) ; return nv ; } catch (ExprEvalException ex) {} } throw new ExprEvalException("COALESCE: no value") ; }
protected abstract NodeValue eval(List<NodeValue> args) ;
@Override final public NodeValue eval(Binding binding, FunctionEnv env) { NodeValue s = evalSpecial(binding, env) ; if ( s != null ) return s ; List<NodeValue> argsEval = new ArrayList<NodeValue>() ; for ( int i = 1 ; i <= numArgs() ; i++ ) { NodeValue x = eval(binding, env, getArg(i)) ; argsEval.add(x) ; } return eval(argsEval, env) ; }
protected ExprFunctionN(String fName, Expr... args) { this(fName, argList(args)) ; }