jrun.ejb.ejbql
Class OperatorBase

java.lang.Object
  |
  +--jrun.ejb.ejbql.OperatorBase
All Implemented Interfaces:
Element, Operator
Direct Known Subclasses:
BinaryOperator, NaryOperator, UnaryOperator

public abstract class OperatorBase
extends java.lang.Object
implements Operator

Common implementation shared by concrete operators.

Author:
Enrique Duvos

Field Summary
protected static java.lang.String BOOLEAN_OBJECT_TYPE_NAME
           
protected static java.lang.String BOOLEAN_PRIMITIVE_TYPE_NAME
           
protected static java.lang.String DOUBLE_OBJECT_TYPE_NAME
           
protected static java.lang.String DOUBLE_PRIMITIVE_TYPE_NAME
           
protected static java.lang.String FLOAT_OBJECT_TYPE_NAME
           
protected static java.lang.String FLOAT_PRIMITIVE_TYPE_NAME
           
protected static java.lang.String INTEGER_OBJECT_TYPE_NAME
           
protected static java.lang.String INTEGER_PRIMITIVE_TYPE_NAME
           
protected static java.lang.String LONG_OBJECT_TYPE_NAME
           
protected static java.lang.String LONG_PRIMITIVE_TYPE_NAME
           
protected static java.lang.String STRING_TYPE_NAME
           
 
Fields inherited from interface jrun.ejb.ejbql.Element
UNSPECIFIED_TRAVERSAL_ORDER
 
Constructor Summary
OperatorBase()
           
 
Method Summary
 void accept(Visitor visitor)
          The standard accept implementation.
 void acceptOperatorExpression(Visitor visitor, OperatorExpression operatorExpr)
          This is used when an operator expression delegates its accept method to an operator.
 boolean equals(java.lang.Object other)
           
 java.util.ListIterator getChildren(int traversalType)
          Operators are leaf elements.
protected static boolean hasBooleanType(Expression expr)
           
protected static boolean hasDoubleType(Expression expr)
           
protected static boolean hasFloatType(Expression expr)
           
protected static boolean hasIntegerType(Expression expr)
           
protected static boolean hasLongType(Expression expr)
           
protected static boolean hasNumericType(Expression expr)
           
protected static boolean hasSmallerNumericType(Expression expr, java.lang.String arithmeticType)
           
protected static boolean hasStringType(Expression expr)
           
 boolean isBinary()
           
 boolean isFunction()
           
 boolean isNary()
           
 boolean isUnary()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface jrun.ejb.ejbql.Operator
getPrintStrings, getResultType, operatesOn
 

Field Detail

STRING_TYPE_NAME

protected static final java.lang.String STRING_TYPE_NAME

BOOLEAN_OBJECT_TYPE_NAME

protected static final java.lang.String BOOLEAN_OBJECT_TYPE_NAME

BOOLEAN_PRIMITIVE_TYPE_NAME

protected static final java.lang.String BOOLEAN_PRIMITIVE_TYPE_NAME

INTEGER_OBJECT_TYPE_NAME

protected static final java.lang.String INTEGER_OBJECT_TYPE_NAME

INTEGER_PRIMITIVE_TYPE_NAME

protected static final java.lang.String INTEGER_PRIMITIVE_TYPE_NAME

LONG_OBJECT_TYPE_NAME

protected static final java.lang.String LONG_OBJECT_TYPE_NAME

LONG_PRIMITIVE_TYPE_NAME

protected static final java.lang.String LONG_PRIMITIVE_TYPE_NAME

FLOAT_OBJECT_TYPE_NAME

protected static final java.lang.String FLOAT_OBJECT_TYPE_NAME

FLOAT_PRIMITIVE_TYPE_NAME

protected static final java.lang.String FLOAT_PRIMITIVE_TYPE_NAME

DOUBLE_OBJECT_TYPE_NAME

protected static final java.lang.String DOUBLE_OBJECT_TYPE_NAME

DOUBLE_PRIMITIVE_TYPE_NAME

protected static final java.lang.String DOUBLE_PRIMITIVE_TYPE_NAME
Constructor Detail

OperatorBase

public OperatorBase()
Method Detail

hasSmallerNumericType

protected static boolean hasSmallerNumericType(Expression expr,
                                               java.lang.String arithmeticType)

hasNumericType

protected static boolean hasNumericType(Expression expr)

hasBooleanType

protected static boolean hasBooleanType(Expression expr)

hasStringType

protected static boolean hasStringType(Expression expr)

hasIntegerType

protected static boolean hasIntegerType(Expression expr)

hasLongType

protected static boolean hasLongType(Expression expr)

hasFloatType

protected static boolean hasFloatType(Expression expr)

hasDoubleType

protected static boolean hasDoubleType(Expression expr)

accept

public void accept(Visitor visitor)
The standard accept implementation. This is used when operator is directly visited.
Specified by:
accept in interface Element

acceptOperatorExpression

public void acceptOperatorExpression(Visitor visitor,
                                     OperatorExpression operatorExpr)
This is used when an operator expression delegates its accept method to an operator. Default behavior is to visitOperatorExpression. This is overridden by some operators.
Specified by:
acceptOperatorExpression in interface Operator

getChildren

public java.util.ListIterator getChildren(int traversalType)
Operators are leaf elements.
Specified by:
getChildren in interface Element

isUnary

public boolean isUnary()
Specified by:
isUnary in interface Operator

isBinary

public boolean isBinary()
Specified by:
isBinary in interface Operator

isNary

public boolean isNary()
Specified by:
isNary in interface Operator

isFunction

public boolean isFunction()
Specified by:
isFunction in interface Operator

equals

public boolean equals(java.lang.Object other)
Overrides:
equals in class java.lang.Object


Copyright � 2002 Macromedia Corporation. All Rights Reserved.