예제 #1
0
  @Override
  public Object evaluate(Environment env, List<Expression> args) {
    if (args.size() != 1) {
      throw new ExpressionException("Cannot call SIN on " + args.size() + " arguments");
    }

    Object argVal = args.get(0).evaluate(env);

    if (argVal == null) return null;

    return Math.sin(TypeConverter.getDoubleValue(argVal));
  }
예제 #2
0
  @Override
  public Object evaluate(Environment env, List<Expression> args) {
    if (args.size() != 1) {
      throw new ExpressionException(
          "Cannot call RESET_PERF_COUNTER on " + args.size() + " arguments");
    }

    Object argVal = args.get(0).evaluate(env);

    if (argVal == null) return null;

    return PerformanceCounters.clear(TypeConverter.getStringValue(argVal));
  }