org.eigenbase.sql
Class SqlJdbcFunctionCall.MakeCall

java.lang.Object
  extended by org.eigenbase.sql.SqlJdbcFunctionCall.MakeCall
Enclosing class:
SqlJdbcFunctionCall

private static class SqlJdbcFunctionCall.MakeCall
extends Object

Represent a Strategy Object to create a SqlCall by providing the feature of reording, adding/dropping operands.


Field Summary
(package private)  int[] argCounts
          List of the possible numbers of operands this function can take.
(package private)  SqlOperator operator
           
(package private)  int[] order
           
 
Constructor Summary
private SqlJdbcFunctionCall.MakeCall(SqlOperator operator, int argCount)
           
(package private) SqlJdbcFunctionCall.MakeCall(SqlOperator operator, int argCount, int[] order)
          Creates a MakeCall strategy object with reordering of operands.
 
Method Summary
(package private)  boolean checkNumberOfArg(int length)
          Returns false if number of arguments are unexpected, otherwise true.
(package private)  SqlCall createCall(SqlNode[] operands, SqlParserPos pos)
          Creates and return a SqlCall.
(package private)  int[] getPossibleArgCounts()
           
protected  SqlNode[] reorder(SqlNode[] operands)
          Uses the data in order to reorder a SqlNode[] array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operator

final SqlOperator operator

order

final int[] order

argCounts

final int[] argCounts
List of the possible numbers of operands this function can take.

Constructor Detail

SqlJdbcFunctionCall.MakeCall

private SqlJdbcFunctionCall.MakeCall(SqlOperator operator,
                                     int argCount)

SqlJdbcFunctionCall.MakeCall

SqlJdbcFunctionCall.MakeCall(SqlOperator operator,
                             int argCount,
                             int[] order)
Creates a MakeCall strategy object with reordering of operands.

The reordering is specified by an int array where the value of element at position i indicates to which element in a new SqlNode[] array the operand goes.

Parameters:
operator -
order -
"Precondition:"
order != null, order[i] < order.length, order.length > 0, argCounts == order.length
Method Detail

getPossibleArgCounts

final int[] getPossibleArgCounts()

reorder

protected SqlNode[] reorder(SqlNode[] operands)
Uses the data in order to reorder a SqlNode[] array.

Parameters:
operands -

createCall

SqlCall createCall(SqlNode[] operands,
                   SqlParserPos pos)
Creates and return a SqlCall. If the MakeCall strategy object was created with a reording specified the call will be created with the operands reordered, otherwise no change of ordering is applied

Parameters:
operands -

checkNumberOfArg

boolean checkNumberOfArg(int length)
Returns false if number of arguments are unexpected, otherwise true. This function is supposed to be called with an SqlNode array of operands direct from the oven, e.g no reording or adding/dropping of operands...else it would make much sense to have this methods