FileDocCategorySizeDatePackage
AvgNode.javaAPI DocGlassfish v2 API3416Tue May 22 16:54:36 BST 2007oracle.toplink.essentials.internal.parsing

AvgNode

public class AvgNode extends AggregateNode
INTERNAL

Purpose: Model a AVG

Responsibilities:

  • Apply itself to a query correctly

Fields Summary
Constructors Summary
Methods Summary
protected oracle.toplink.essentials.expressions.ExpressionaddAggregateExression(oracle.toplink.essentials.expressions.Expression expr)
INTERNAL

        return expr.average();
    
public voidapplyToQuery(oracle.toplink.essentials.queryframework.ObjectLevelReadQuery theQuery, oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Apply this node to the passed query

        if (theQuery.isReportQuery()) {
            ReportQuery reportQuery = (ReportQuery)theQuery;
            reportQuery.addAttribute(resolveAttribute(), 
                                     generateExpression(context), Double.class);
        }
    
public java.lang.StringgetAsString()
INTERNAL Get the string representation of this node.

        return "AVG(" + left.getAsString() + ")";
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate node and calculate its type.

        if (left != null) {
            left.validate(context);
        }
        TypeHelper typeHelper = context.getTypeHelper();
        setType(typeHelper.getDoubleClassType());