Beispiel #1
0
  public static FieldValue evaluate(
      Apply apply, List<FieldValue> values, EvaluationContext context) {
    String name = apply.getFunction();

    Function function = getFunction(name);
    if (function == null) {
      DefineFunction defineFunction = context.resolveFunction(name);
      if (defineFunction == null) {
        throw new UnsupportedFeatureException(apply);
      }

      return evaluate(defineFunction, values, context);
    }

    return function.evaluate(values);
  }
Beispiel #2
0
 private FunctionEntry add(String name, Function function) {
   final FunctionEntryImpl entry = new FunctionEntryImpl(this, name, function);
   functionMap.put(name, entry);
   if (function.getParameters().isEmpty()) {
     nullaryFunctionMapInsensitive.put(name, entry);
   }
   return entry;
 }