org.eigenbase.sql.type
Class SqlReturnTypeInferenceChain

java.lang.Object
  extended by org.eigenbase.sql.type.SqlReturnTypeInferenceChain
All Implemented Interfaces:
SqlReturnTypeInference

public class SqlReturnTypeInferenceChain
extends Object
implements SqlReturnTypeInference

Strategy to infer the type of an operator call from the type of the operands by using a series of SqlReturnTypeInference rules in a given order. If a rule fails to find a return type (by returning NULL), next rule is tried until there are no more rules in which case NULL will be returned.

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

Field Summary
private  SqlReturnTypeInference[] rules
           
 
Constructor Summary
SqlReturnTypeInferenceChain(SqlReturnTypeInference[] rules)
          Creates a FallbackCascade from an array of rules
SqlReturnTypeInferenceChain(SqlReturnTypeInference rule1, SqlReturnTypeInference rule2)
          Creates a FallbackCascade from two rules
 
Method Summary
 RelDataType inferReturnType(SqlOperatorBinding opBinding)
          Infers the return type of a call to an SqlOperator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rules

private final SqlReturnTypeInference[] rules
Constructor Detail

SqlReturnTypeInferenceChain

public SqlReturnTypeInferenceChain(SqlReturnTypeInference[] rules)
Creates a FallbackCascade from an array of rules

"Precondition:"
null!=rules, null!=rules[i], rules.length > 0

SqlReturnTypeInferenceChain

public SqlReturnTypeInferenceChain(SqlReturnTypeInference rule1,
                                   SqlReturnTypeInference rule2)
Creates a FallbackCascade from two rules

Method Detail

inferReturnType

public RelDataType inferReturnType(SqlOperatorBinding opBinding)
Description copied from interface: SqlReturnTypeInference
Infers the return type of a call to an SqlOperator.

Specified by:
inferReturnType in interface SqlReturnTypeInference
Parameters:
opBinding - description of operator binding
Returns:
inferred type