org.eigenbase.sql.fun
Class SqlMonotonicBinaryOperator

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlBinaryOperator
          extended by org.eigenbase.sql.fun.SqlMonotonicBinaryOperator

public class SqlMonotonicBinaryOperator
extends SqlBinaryOperator

Base class for binary operators such as addition, subtraction, and multiplication which are monotonic for the patterns m op c and c op m where m is any monotonic expression and c is a constant.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/fun/SqlMonotonicBinaryOperator.java#8 $
Author:
John V. Sichi

Field Summary
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlMonotonicBinaryOperator(String name, SqlKind kind, int prec, boolean isLeftAssoc, SqlReturnTypeInference returnTypeInference, SqlOperandTypeInference operandTypeInference, SqlOperandTypeChecker operandTypeChecker)
           
 
Method Summary
private  void assertMonotonicity(String s, SqlMonotonicity monotonicity)
           
 SqlMonotonicity getMonotonicity(SqlCall call, SqlValidatorScope scope)
          Returns whether this operator is monotonic.
 
Methods inherited from class org.eigenbase.sql.SqlBinaryOperator
adjustType, deriveType, getSignatureTemplate, getSyntax
 
Methods inherited from class org.eigenbase.sql.SqlOperator
acceptCall, acceptCall, argumentMustBeScalar, checkOperandCount, checkOperandTypes, createCall, createCall, createCall, createCall, equals, getAllowedSignatures, getAllowedSignatures, getKind, getLeftPrec, getName, getOperandCountRange, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparse, unparseListClause, unparseListClause, validateCall, validateOperands
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SqlMonotonicBinaryOperator

public SqlMonotonicBinaryOperator(String name,
                                  SqlKind kind,
                                  int prec,
                                  boolean isLeftAssoc,
                                  SqlReturnTypeInference returnTypeInference,
                                  SqlOperandTypeInference operandTypeInference,
                                  SqlOperandTypeChecker operandTypeChecker)
Method Detail

getMonotonicity

public SqlMonotonicity getMonotonicity(SqlCall call,
                                       SqlValidatorScope scope)
Description copied from class: SqlOperator
Returns whether this operator is monotonic.

Default implementation returns SqlMonotonicity.NotMonotonic.

Overrides:
getMonotonicity in class SqlBinaryOperator
Parameters:
call - Call to this operator
scope - Scope in which the call occurs

assertMonotonicity

private void assertMonotonicity(String s,
                                SqlMonotonicity monotonicity)