org.eigenbase.sql.type
Interface SqlOperandTypeChecker

All Known Subinterfaces:
SqlSingleOperandTypeChecker
All Known Implementing Classes:
AssignableOperandTypeChecker, ComparableOperandTypeChecker, CompositeOperandTypeChecker, FamilyOperandTypeChecker, LiteralOperandTypeChecker, MultisetOperandTypeChecker, SameOperandTypeChecker, SetopOperandTypeChecker

public interface SqlOperandTypeChecker

Strategy interface to check for allowed operand types of an operator call.

This interface is an example of the strategy pattern.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/type/SqlOperandTypeChecker.java#6 $
Author:
Wael Chatila

Method Summary
 boolean checkOperandTypes(SqlCallBinding callBinding, boolean throwOnFailure)
          Checks the types of all operands to an operator call.
 String getAllowedSignatures(SqlOperator op, String opName)
          Returns a string describing the allowed formal signatures of a call, e.g.
 SqlOperandCountRange getOperandCountRange()
           
 

Method Detail

checkOperandTypes

boolean checkOperandTypes(SqlCallBinding callBinding,
                          boolean throwOnFailure)
Checks the types of all operands to an operator call.

Parameters:
callBinding - description of the call to be checked
throwOnFailure - whether to throw an exception if check fails (otherwise returns false in that case)
Returns:
whether check succeeded

getOperandCountRange

SqlOperandCountRange getOperandCountRange()
Returns:
range of operand counts allowed in a call

getAllowedSignatures

String getAllowedSignatures(SqlOperator op,
                            String opName)
Returns a string describing the allowed formal signatures of a call, e.g. "SUBSTR(VARCHAR, INTEGER, INTEGER)".

Parameters:
op - the operator being checked
opName - name to use for the operator in case of aliasing
Returns:
generated string