/** final - autoclose and registration relies on it - implement moveToNextBinding() */ @Override public final T next() { if ( ! hasNext() ) throw new NoSuchElementException(Lib.className(this)) ; T obj = slot ; slot = null ; slotIsSet = false ; return obj ; }
@Override public T next() { if ( ! hasNext() ) throw new NoSuchElementException(Lib.className(this)+".next()/finished") ; return currentStage.next() ; }
@Override public NodeValue exec(List<NodeValue> args) { if ( args.size() < 2 ) throw new ExprEvalException(Lib.className(this)+": Wrong number of arguments: "+ args.size()+" : [wanted at least 2]") ; NodeValue v1 = args.get(0) ; List<NodeValue> allArgs = new ArrayList<>(); for(int i = 1;i < args.size();i++) allArgs.add(args.get(i)); return XSDFuncOp.javaSprintf(v1, allArgs) ; } }
@Override public NodeValue exec(List<NodeValue> args) { if ( args.size() != 2 && args.size() != 3 ) throw new ExprEvalException("Function '"+Lib.className(this)+"' takes two or three arguments") ; NodeValue value = args.get(0) ; NodeValue picture = args.get(1) ; NodeValue decimalFormatName = null ; if ( args.size() == 3) decimalFormatName = args.get(2) ; return XSDFuncOp.formatNumber(value, picture, decimalFormatName) ; } }
@Override public final NodeValue exec(List<NodeValue> args) { if ( args == null ) // The contract on the function interface is that this should not happen. throw new ARQInternalErrorException("Function '"+Lib.className(this)+" Null args list") ; if ( args.size() != 0 ) throw new ExprEvalException("Function '"+Lib.className(this)+" Wanted 0, got "+args.size()) ; return exec() ; }
public void setVar(Var v) { if (this.var != null) throw new ARQInternalErrorException(Lib.className(this)+ ": Attempt to set variable to " + v + " when already set as " + this.var) ; if (v == null) throw new ARQInternalErrorException(Lib.className(this)+ ": Attempt to set variable to null") ; _setVar(v) ; }
@Override public void checkBuild(String uri, ExprList args) { if ( args.size() != 0 ) throw new QueryBuildException("Function '"+Lib.className(this)+"' takes no arguments") ; }
@Override public void checkBuild(String uri, ExprList args) { if(args.size() < 2) throw new QueryBuildException("Function '"+ Lib.className(this)+"' takes at least two arguments") ; }
@Override public void checkBuild(String uri, ExprList args) { if ( args.size() != 1 ) throw new QueryBuildException("Function '"+Lib.className(this)+"' takes one argument") ; }
@Override public void checkBuild(String uri, ExprList args) { if (args.size() != 5) { throw new QueryBuildException("Function '" + Lib.className(this) + "' takes five arguments"); } }
@Override public void checkBuild(String uri, ExprList args) { if ( args.size() != 2 ) throw new QueryBuildException("Function '"+Lib.className(this)+"' takes two arguments") ; }
@Override public void checkBuild(String uri, ExprList args) { if (args.size() < 1 || args.size() > 2) throw new QueryBuildException("Function '" + Lib.className(this) + "' takes one/two argument(s)"); }
@Override public void checkBuild(String uri, ExprList args) { if ( args.size() != 1 && args.size() != 2 ) throw new QueryBuildException("Function '"+ Lib.className(this)+"' takes one or two arguments") ; } @Override
@Override protected void details(IndentedWriter out, SerializationContext cxt) { out.print(Lib.className(this)) ; out.print(" ") ; ExprUtils.fmtSPARQL(out, expr, cxt) ; }
@Override public void checkBuild(String uri, ExprList args) { if (args.size() != 4 && args.size() != 6) throw new QueryBuildException("Function '" + Lib.className(this) + "' takes 4 or 6 argument(s)"); }
@Override public void checkBuild(String uri, ExprList args) { if ( args.size() != 1 && args.size() != 2 ) throw new QueryBuildException("Function '"+ Lib.className(this)+"' takes one or two arguments") ; } @Override
@Override protected void details(IndentedWriter out, SerializationContext sCxt) { out.println(Lib.className(this)) ; out.incIndent() ; op.output(out, sCxt) ; out.decIndent() ; } }
public static NodeValue get(Symbol symbol, FunctionEnv env) { Object obj = env.getContext().get(symbol); if ( obj == null ) throw new ExprEvalException("null for symbol: " + symbol); if ( !(obj instanceof Node) ) throw new ExprEvalException("Not a Node: " + Lib.className(obj)); Node n = (Node)obj; NodeValue nv = NodeValue.makeNode(n); return nv; } }
@Override protected void details(IndentedWriter out, SerializationContext sCxt) { out.print(Lib.className(this)) ; out.println() ; out.incIndent() ; out.print(triplePath.toString()) ; out.decIndent() ; } }