jrun.ejb.ejbql
Class BinaryOperator

java.lang.Object
  |
  +--jrun.ejb.ejbql.OperatorBase
        |
        +--jrun.ejb.ejbql.BinaryOperator
All Implemented Interfaces:
Element, Operator

public abstract class BinaryOperator
extends OperatorBase

An operator that takes two operands.

Author:
Enrique Duvos

Field Summary
static BinaryOperator ADD
           
static BinaryOperator CONCAT
           
static boolean debug
           
static BinaryOperator DIVIDE
           
static BinaryOperator EQUAL
           
static BinaryOperator GREATER_THAN
           
static BinaryOperator GREATER_THAN_OR_EQUAL
           
static BinaryOperator IN_STRINGS
           
static BinaryOperator LESS_THAN
           
static BinaryOperator LESS_THAN_OR_EQUAL
           
static BinaryOperator MEMBER_OF
           
static BinaryOperator MULTIPLY
           
static BinaryOperator NOT_EQUAL
           
static BinaryOperator NOT_IN_STRINGS
           
static BinaryOperator NOT_MEMBER_OF
           
static BinaryOperator SELECT_FIELD
           
static BinaryOperator SUBTRACT
           
 
Fields inherited from class jrun.ejb.ejbql.OperatorBase
BOOLEAN_OBJECT_TYPE_NAME, BOOLEAN_PRIMITIVE_TYPE_NAME, DOUBLE_OBJECT_TYPE_NAME, DOUBLE_PRIMITIVE_TYPE_NAME, FLOAT_OBJECT_TYPE_NAME, FLOAT_PRIMITIVE_TYPE_NAME, INTEGER_OBJECT_TYPE_NAME, INTEGER_PRIMITIVE_TYPE_NAME, LONG_OBJECT_TYPE_NAME, LONG_PRIMITIVE_TYPE_NAME, STRING_TYPE_NAME
 
Fields inherited from interface jrun.ejb.ejbql.Element
UNSPECIFIED_TRAVERSAL_ORDER
 
Constructor Summary
BinaryOperator()
           
 
Method Summary
protected abstract  java.lang.String doGetPrintString()
           
protected  java.lang.String getBinaryPromotionType(Expression firstExpr, Expression secondExpr)
          Binary numeric type promotion.
 java.util.Iterator getPrintStrings(java.util.Vector expressions)
          Return the operator strings to be used to print out the entire expression.
 java.lang.String getResultType(Expression firstExpr, Expression secondExpr)
           
 java.lang.String getResultType(java.util.Vector expressions)
          The stringified version of the java Class type that results from applying the operator to the given set of expressions.
 boolean isBinary()
           
abstract  boolean operatesOn(Expression firstExpression, Expression secondExpression)
           
 boolean operatesOn(java.util.Vector expressions)
          True if an operator can be applied to a given set of expressions.
 
Methods inherited from class jrun.ejb.ejbql.OperatorBase
accept, acceptOperatorExpression, equals, getChildren, hasBooleanType, hasDoubleType, hasFloatType, hasIntegerType, hasLongType, hasNumericType, hasSmallerNumericType, hasStringType, isFunction, isNary, isUnary
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug

IN_STRINGS

public static final BinaryOperator IN_STRINGS

NOT_IN_STRINGS

public static final BinaryOperator NOT_IN_STRINGS

EQUAL

public static final BinaryOperator EQUAL

NOT_EQUAL

public static final BinaryOperator NOT_EQUAL

GREATER_THAN

public static final BinaryOperator GREATER_THAN

GREATER_THAN_OR_EQUAL

public static final BinaryOperator GREATER_THAN_OR_EQUAL

LESS_THAN_OR_EQUAL

public static final BinaryOperator LESS_THAN_OR_EQUAL

LESS_THAN

public static final BinaryOperator LESS_THAN

ADD

public static final BinaryOperator ADD

SUBTRACT

public static final BinaryOperator SUBTRACT

MULTIPLY

public static final BinaryOperator MULTIPLY

DIVIDE

public static final BinaryOperator DIVIDE

CONCAT

public static final BinaryOperator CONCAT

MEMBER_OF

public static final BinaryOperator MEMBER_OF

NOT_MEMBER_OF

public static final BinaryOperator NOT_MEMBER_OF

SELECT_FIELD

public static final BinaryOperator SELECT_FIELD
Constructor Detail

BinaryOperator

public BinaryOperator()
Method Detail

isBinary

public boolean isBinary()
Overrides:
isBinary in class OperatorBase

operatesOn

public boolean operatesOn(java.util.Vector expressions)
Description copied from interface: Operator
True if an operator can be applied to a given set of expressions. E.g. The Plus operator can only operate on exactly two expressions, each of which has numeric type.

operatesOn

public abstract boolean operatesOn(Expression firstExpression,
                                   Expression secondExpression)

getResultType

public java.lang.String getResultType(java.util.Vector expressions)
Description copied from interface: Operator
The stringified version of the java Class type that results from applying the operator to the given set of expressions.

getResultType

public java.lang.String getResultType(Expression firstExpr,
                                      Expression secondExpr)

getBinaryPromotionType

protected java.lang.String getBinaryPromotionType(Expression firstExpr,
                                                  Expression secondExpr)
Binary numeric type promotion. JLS 5.6.2

getPrintStrings

public java.util.Iterator getPrintStrings(java.util.Vector expressions)
Description copied from interface: Operator
Return the operator strings to be used to print out the entire expression. Might be multiple strings, e.g. Expr1 BETWEEN Expr2 AND Expr3 print strings = { "BETWEEN", "AND" }

doGetPrintString

protected abstract java.lang.String doGetPrintString()


Copyright � 2002 Macromedia Corporation. All Rights Reserved.