Purpose: Model a AVG
Responsibilities:
INTERNAL return expr.average();
return expr.average();
INTERNAL Apply this node to the passed query if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute(resolveAttribute(), generateExpression(context), Double.class); }
if (theQuery.isReportQuery()) { ReportQuery reportQuery = (ReportQuery)theQuery; reportQuery.addAttribute(resolveAttribute(), generateExpression(context), Double.class); }
INTERNAL Get the string representation of this node. return "AVG(" + left.getAsString() + ")";
return "AVG(" + left.getAsString() + ")";
INTERNAL Validate node and calculate its type. if (left != null) { left.validate(context); } TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getDoubleClassType());
if (left != null) { left.validate(context); } TypeHelper typeHelper = context.getTypeHelper(); setType(typeHelper.getDoubleClassType());