org.eigenbase.sql.type
Class MatchReturnTypeInference

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

public class MatchReturnTypeInference
extends Object
implements SqlReturnTypeInference

Returns the first type that matches a set of given SqlTypeNames. If no match could be found, null is returned.

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

Field Summary
private  int start
           
private  SqlTypeName[] typeNames
           
 
Constructor Summary
MatchReturnTypeInference(int start)
          Returns the type at element start (zero based).
MatchReturnTypeInference(int start, SqlTypeName typeName)
          Returns the first type of typeName at or after position start (zero based).
MatchReturnTypeInference(int start, SqlTypeName[] typeNames)
          Returns the first type matching any type in typeNames at or after position start (zero based)
 
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

start

private final int start

typeNames

private final SqlTypeName[] typeNames
Constructor Detail

MatchReturnTypeInference

public MatchReturnTypeInference(int start)
Returns the type at element start (zero based).

See Also:
MatchReturnTypeInference(int, SqlTypeName[])

MatchReturnTypeInference

public MatchReturnTypeInference(int start,
                                SqlTypeName typeName)
Returns the first type of typeName at or after position start (zero based).

See Also:
MatchReturnTypeInference(int, SqlTypeName[])

MatchReturnTypeInference

public MatchReturnTypeInference(int start,
                                SqlTypeName[] typeNames)
Returns the first type matching any type in typeNames at or after position start (zero based)

"Precondition:"
start>=0, null!=typeNames, typeNames.length>0
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