org.eigenbase.rex
Class RexCallBinding

java.lang.Object
  extended by org.eigenbase.sql.SqlOperatorBinding
      extended by org.eigenbase.rex.RexCallBinding

public class RexCallBinding
extends SqlOperatorBinding

RexCallBinding implements SqlOperatorBinding by referring to an underlying collection of RexNode operands.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/rex/RexCallBinding.java#11 $
Author:
Wael Chatila

Field Summary
private  RexNode[] operands
           
 
Fields inherited from class org.eigenbase.sql.SqlOperatorBinding
typeFactory
 
Constructor Summary
RexCallBinding(RelDataTypeFactory typeFactory, SqlOperator sqlOperator, RexNode[] operands)
           
 
Method Summary
 int getIntLiteralOperand(int ordinal)
          Gets the integer value of a numeric literal operand.
 int getOperandCount()
           
 RelDataType getOperandType(int ordinal)
          Gets the type of a bound operand.
 String getStringLiteralOperand(int ordinal)
          Gets the string value of a string literal 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, getOperator, getTypeFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operands

private final RexNode[] operands
Constructor Detail

RexCallBinding

public RexCallBinding(RelDataTypeFactory typeFactory,
                      SqlOperator sqlOperator,
                      RexNode[] operands)
Method Detail

getStringLiteralOperand

public String getStringLiteralOperand(int ordinal)
Description copied from class: SqlOperatorBinding
Gets the string value of a string literal operand.

Overrides:
getStringLiteralOperand in class SqlOperatorBinding
Parameters:
ordinal - zero-based ordinal of operand of interest
Returns:
string value

getIntLiteralOperand

public int getIntLiteralOperand(int ordinal)
Description copied from class: SqlOperatorBinding
Gets the integer value of a numeric literal operand.

Overrides:
getIntLiteralOperand in class SqlOperatorBinding
Parameters:
ordinal - zero-based ordinal of operand of interest
Returns:
integer value

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

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