org.eigenbase.sql
Class ExplicitOperatorBinding

java.lang.Object
  extended by org.eigenbase.sql.SqlOperatorBinding
      extended by org.eigenbase.sql.ExplicitOperatorBinding

public class ExplicitOperatorBinding
extends SqlOperatorBinding

ExplicitOperatorBinding implements SqlOperatorBinding via an underlying array of known operand types.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/ExplicitOperatorBinding.java#12 $
Author:
Wael Chatila

Field Summary
private  SqlOperatorBinding delegate
           
private  RelDataType[] types
           
 
Fields inherited from class org.eigenbase.sql.SqlOperatorBinding
typeFactory
 
Constructor Summary
  ExplicitOperatorBinding(RelDataTypeFactory typeFactory, SqlOperator operator, RelDataType[] types)
           
  ExplicitOperatorBinding(SqlOperatorBinding delegate, RelDataType[] types)
           
private ExplicitOperatorBinding(SqlOperatorBinding delegate, RelDataTypeFactory typeFactory, SqlOperator operator, RelDataType[] types)
           
 
Method Summary
 int getOperandCount()
           
 RelDataType getOperandType(int ordinal)
          Gets the type of a bound operand.
 boolean isOperandNull(int ordinal, boolean allowCast)
          Determines whether a bound operand is NULL.
 EigenbaseException newError(SqlValidatorException e)
          Wraps a validation error with context appropriate to this operator call.
 
Methods inherited from class org.eigenbase.sql.SqlOperatorBinding
collectOperandTypes, getColumnListParamInfo, getCursorOperand, getIntLiteralOperand, getOperator, getStringLiteralOperand, getTypeFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

private final RelDataType[] types

delegate

private final SqlOperatorBinding delegate
Constructor Detail

ExplicitOperatorBinding

public ExplicitOperatorBinding(SqlOperatorBinding delegate,
                               RelDataType[] types)

ExplicitOperatorBinding

public ExplicitOperatorBinding(RelDataTypeFactory typeFactory,
                               SqlOperator operator,
                               RelDataType[] types)

ExplicitOperatorBinding

private ExplicitOperatorBinding(SqlOperatorBinding delegate,
                                RelDataTypeFactory typeFactory,
                                SqlOperator operator,
                                RelDataType[] types)
Method Detail

getOperandCount

public int getOperandCount()
Specified by:
getOperandCount in class SqlOperatorBinding
Returns:
the number of bound operands

getOperandType

public RelDataType getOperandType(int ordinal)
Description copied from class: SqlOperatorBinding
Gets the type of a bound operand.

Specified by:
getOperandType in class SqlOperatorBinding
Parameters:
ordinal - zero-based ordinal of operand of interest
Returns:
bound operand type

newError

public EigenbaseException newError(SqlValidatorException e)
Description copied from class: SqlOperatorBinding
Wraps a validation error with context appropriate to this operator call.

Specified by:
newError in class SqlOperatorBinding
Parameters:
e - Validation error
Returns:
Error wrapped, if possible, with positional information

isOperandNull

public boolean isOperandNull(int ordinal,
                             boolean allowCast)
Description copied from class: SqlOperatorBinding
Determines whether a bound operand is NULL.

This is only relevant for SQL validation.

Overrides:
isOperandNull in class SqlOperatorBinding
Parameters:
ordinal - zero-based ordinal of operand of interest
allowCast - whether to regard CAST(constant) as a constant
Returns:
whether operand is null; false for everything except SQL validation