Package org.gdbms.engine.function

Examples of org.gdbms.engine.function.Function


   * @see org.gdbms.engine.instruction.Expression#evaluate(long)
   */
  public Value evaluate(long row) throws EvaluationException {
    String functionName = getEntity().first_token.image;

    Function func = getFunction();

    if (func == null) {
      throw new EvaluationException("No function called " + functionName);
    }

    Adapter[] params = this.getChilds()[0].getChilds();
    Value[] paramValues = new Value[params.length];

    for (int i = 0; i < paramValues.length; i++) {
      paramValues[i] = ((Expression) params[i]).evaluate(row);
    }

    try {
      return func.evaluate(paramValues);
    } catch (FunctionException e) {
      throw new EvaluationException("Function error", e);
    }
  }
View Full Code Here

TOP

Related Classes of org.gdbms.engine.function.Function

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.