FileDocCategorySizeDatePackage
UnaryMinus.javaAPI DocGlassfish v2 API3212Tue May 22 16:54:40 BST 2007oracle.toplink.essentials.internal.parsing

UnaryMinus

public class UnaryMinus extends Node
INTERNAL

Purpose: Represent an unary '-' in EJBQL

Responsibilities:

  • Generate the correct expression for an unary '-'

Fields Summary
Constructors Summary
public UnaryMinus()

        super();
    
Methods Summary
public oracle.toplink.essentials.expressions.ExpressiongenerateExpression(oracle.toplink.essentials.internal.parsing.GenerationContext context)
INTERNAL Generate the expression.

        Expression whereClause = new ConstantExpression(new Integer(0), new ExpressionBuilder());
        whereClause = ExpressionMath.subtract(whereClause, getLeft().generateExpression(context));
        return whereClause;
    
public voidvalidate(oracle.toplink.essentials.internal.parsing.ParseTreeContext context)
INTERNAL Validate node and calculate its type.

        if (left != null) {
            left.validate(context);
            setType(left.getType());
        }
    
public voidvalidateParameter(oracle.toplink.essentials.internal.parsing.ParseTreeContext context, java.lang.Object contextType)
INTERNAL

        // delegate to the argument node
        left.validateParameter(context, contextType);