org.eigenbase.sql.fun
Class SqlOverlapsOperator

java.lang.Object
  extended by org.eigenbase.sql.SqlOperator
      extended by org.eigenbase.sql.SqlSpecialOperator
          extended by org.eigenbase.sql.fun.SqlOverlapsOperator

public class SqlOverlapsOperator
extends SqlSpecialOperator

SqlOverlapsOperator represents the SQL:1999 standard OVERLAPS function Determins if two anchored time intervals overlaps.

Since:
Dec 11, 2004
Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/fun/SqlOverlapsOperator.java#17 $
Author:
Wael Chatila

Field Summary
private static SqlWriter.FrameType OverlapsFrameType
           
 
Fields inherited from class org.eigenbase.sql.SqlOperator
MaxPrec, NL
 
Constructor Summary
SqlOverlapsOperator()
           
 
Method Summary
 boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
          Checks that the operand values in a SqlCall to this operator are valid.
 String getAllowedSignatures(String opName)
          Returns a string describing the expected operand types of a call, e.g.
 SqlOperandCountRange getOperandCountRange()
          Returns a constraint on the number of operands expected by this operator.
 String getSignatureTemplate(int operandsCount)
          Returns a template describing how the operator signature is to be built.
 void unparse(SqlWriter writer, SqlNode[] operands, int leftPrec, int rightPrec)
          Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.
 
Methods inherited from class org.eigenbase.sql.SqlSpecialOperator
getSyntax, reduceExpr
 
Methods inherited from class org.eigenbase.sql.SqlOperator
acceptCall, acceptCall, adjustType, argumentMustBeScalar, checkOperandCount, createCall, createCall, createCall, createCall, deriveType, equals, getAllowedSignatures, getKind, getLeftPrec, getMonotonicity, getName, getOperandTypeChecker, getOperandTypeInference, getReturnTypeInference, getRightPrec, hashCode, inferReturnType, inferReturnType, isAggregator, isDeterministic, isDynamicFunction, isName, leftPrec, preValidateCall, requiresDecimalExpansion, rewriteCall, rightPrec, toString, unparseListClause, unparseListClause, validateCall, validateOperands
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

OverlapsFrameType

private static final SqlWriter.FrameType OverlapsFrameType
Constructor Detail

SqlOverlapsOperator

public SqlOverlapsOperator()
Method Detail

unparse

public void unparse(SqlWriter writer,
                    SqlNode[] operands,
                    int leftPrec,
                    int rightPrec)
Description copied from class: SqlOperator
Writes a SQL representation of a call to this operator to a writer, including parentheses if the operators on either side are of greater precedence.

The default implementation of this method delegates to SqlSyntax.unparse(org.eigenbase.sql.SqlWriter, org.eigenbase.sql.SqlOperator, org.eigenbase.sql.SqlNode[], int, int).

Overrides:
unparse in class SqlSpecialOperator

getOperandCountRange

public SqlOperandCountRange getOperandCountRange()
Description copied from class: SqlOperator
Returns a constraint on the number of operands expected by this operator. Subclasses may override this method; when they don't, the range is derived from the SqlOperandTypeChecker associated with this operator.

Overrides:
getOperandCountRange in class SqlOperator
Returns:
acceptable range

getSignatureTemplate

public String getSignatureTemplate(int operandsCount)
Description copied from class: SqlOperator
Returns a template describing how the operator signature is to be built. E.g for the binary + operator the template looks like "{1} {0} {2}" {0} is the operator, subsequent numbers are operands.

Overrides:
getSignatureTemplate in class SqlOperator
Parameters:
operandsCount - is used with functions that can take a variable number of operands
Returns:
signature template, or null to indicate that a default template will suffice

getAllowedSignatures

public String getAllowedSignatures(String opName)
Description copied from class: SqlOperator
Returns a string describing the expected operand types of a call, e.g. "SUBSTRING(VARCHAR, INTEGER, INTEGER)" where the name (SUBSTRING in this example) can be replaced by a specifed name.

Overrides:
getAllowedSignatures in class SqlOperator

checkOperandTypes

public boolean checkOperandTypes(SqlCallBinding callBinding,
                                 boolean throwOnFailure)
Description copied from class: SqlOperator
Checks that the operand values in a SqlCall to this operator are valid. Subclasses must either override this method or supply an instance of SqlOperandTypeChecker to the constructor.

Overrides:
checkOperandTypes in class SqlOperator
Parameters:
callBinding - description of call
throwOnFailure - whether to throw an exception if check fails (otherwise returns false in that case)
Returns:
whether check succeeded