* @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);
}
}