org.eigenbase.oj.rex
Class OJRexImplementorTableImpl

java.lang.Object
  extended by org.eigenbase.oj.rex.OJRexImplementorTableImpl
All Implemented Interfaces:
OJRexImplementorTable
Direct Known Subclasses:
FarragoOJRexImplementorTable

public class OJRexImplementorTableImpl
extends Object
implements OJRexImplementorTable

OJRexImplementorTableImpl is a default implementation of OJRexImplementorTable, containing implementors for standard operators, functions, and aggregates. Say that three times fast.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/oj/rex/OJRexImplementorTableImpl.java#21 $
Author:
John V. Sichi

Nested Class Summary
static class OJRexImplementorTableImpl.OJBasicAggImplementor
           
static class OJRexImplementorTableImpl.OJCountAggImplementor
           
static class OJRexImplementorTableImpl.OJMinMaxAggImplementor
           
static class OJRexImplementorTableImpl.OJSumAggImplementor
          Sum is an aggregator which returns the sum of the values which go into it.
 
Field Summary
private  Map<SqlAggFunction,OJRexImplementorTableImpl.OJSumAggImplementor> aggImplementorMap
           
private static String holderClassName
           
private  Map<SqlOperator,OJRexImplementor> implementorMap
           
private static OJRexImplementorTableImpl instance
           
 
Constructor Summary
protected OJRexImplementorTableImpl()
          Creates an empty table.
 
Method Summary
 OJAggImplementor get(Aggregation agg)
          Retrieves the implementor of an aggregate, or null if there is no implementor registered.
 OJRexImplementor get(SqlOperator op)
          Retrieves the implementor of an operator, or null if there is no implementor registered.
protected  void initStandard(SqlStdOperatorTable opTab)
          Registers implementations for the standard set of functions and operators.
static OJRexImplementorTable instance()
          Creates a table and initializes it with implementations of all of the standard SQL functions and operators.
protected  void registerBinaryOperator(SqlBinaryOperator op, int ojBinaryExpressionOrdinal)
           
 void registerOperator(SqlOperator op, OJRexImplementor implementor)
           
protected  void registerUnaryOperator(SqlPrefixOperator op, int ojUnaryExpressionOrdinal)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static OJRexImplementorTableImpl instance

holderClassName

private static final String holderClassName
See Also:
Constant Field Values

implementorMap

private final Map<SqlOperator,OJRexImplementor> implementorMap

aggImplementorMap

private final Map<SqlAggFunction,OJRexImplementorTableImpl.OJSumAggImplementor> aggImplementorMap
Constructor Detail

OJRexImplementorTableImpl

protected OJRexImplementorTableImpl()
Creates an empty table.

You probably want to call the public method instance instead.

Method Detail

instance

public static OJRexImplementorTable instance()
Creates a table and initializes it with implementations of all of the standard SQL functions and operators.


get

public OJRexImplementor get(SqlOperator op)
Description copied from interface: OJRexImplementorTable
Retrieves the implementor of an operator, or null if there is no implementor registered.

Specified by:
get in interface OJRexImplementorTable

get

public OJAggImplementor get(Aggregation agg)
Description copied from interface: OJRexImplementorTable
Retrieves the implementor of an aggregate, or null if there is no implementor registered.

Specified by:
get in interface OJRexImplementorTable

initStandard

protected void initStandard(SqlStdOperatorTable opTab)
Registers implementations for the standard set of functions and operators.


registerOperator

public void registerOperator(SqlOperator op,
                             OJRexImplementor implementor)

registerBinaryOperator

protected void registerBinaryOperator(SqlBinaryOperator op,
                                      int ojBinaryExpressionOrdinal)

registerUnaryOperator

protected void registerUnaryOperator(SqlPrefixOperator op,
                                     int ojUnaryExpressionOrdinal)