org.eigenbase.sql.util
Class ReflectiveSqlOperatorTable

java.lang.Object
  extended by org.eigenbase.sql.util.ReflectiveSqlOperatorTable
All Implemented Interfaces:
SqlOperatorTable
Direct Known Subclasses:
SqlStdOperatorTable

public abstract class ReflectiveSqlOperatorTable
extends Object
implements SqlOperatorTable

ReflectiveSqlOperatorTable implements the SqlOperatorTable interface by reflecting the public fields of a subclass.

Version:
$Id: //open/dev/farrago/src/org/eigenbase/sql/util/ReflectiveSqlOperatorTable.java#16 $
Author:
John V. Sichi

Field Summary
private  Map<String,SqlOperator> mapNameToOp
           
private  MultiMap<String,SqlOperator> operators
           
 
Constructor Summary
protected ReflectiveSqlOperatorTable()
           
 
Method Summary
 List<SqlOperator> getOperatorList()
          Retrieves a list of all functions and operators in this table.
 void init()
          Performs post-constructor initialization of an operator table.
 List<SqlOperator> lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax)
          Retrieves a list of operators with a given name and syntax.
 void register(SqlFunction function)
          Registers a function in the table.
 void register(SqlOperator op)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

operators

private final MultiMap<String,SqlOperator> operators

mapNameToOp

private final Map<String,SqlOperator> mapNameToOp
Constructor Detail

ReflectiveSqlOperatorTable

protected ReflectiveSqlOperatorTable()
Method Detail

init

public final void init()
Performs post-constructor initialization of an operator table. It can't be part of the constructor, because the subclass constructor needs to complete first.


lookupOperatorOverloads

public List<SqlOperator> lookupOperatorOverloads(SqlIdentifier opName,
                                                 SqlFunctionCategory category,
                                                 SqlSyntax syntax)
Description copied from interface: SqlOperatorTable
Retrieves a list of operators with a given name and syntax. For example, by passing SqlSyntax.Function, the returned list is narrowed to only matching SqlFunction objects.

Specified by:
lookupOperatorOverloads in interface SqlOperatorTable
Parameters:
opName - name of operator
category - function category to look up, or null for any matching operator
syntax - syntax type of operator
Returns:
mutable list of SqlOperator objects (or immutable empty list if no matches)

register

public void register(SqlOperator op)

register

public void register(SqlFunction function)
Registers a function in the table.

Parameters:
function - Function to register

getOperatorList

public List<SqlOperator> getOperatorList()
Description copied from interface: SqlOperatorTable
Retrieves a list of all functions and operators in this table. Used for automated testing.

Specified by:
getOperatorList in interface SqlOperatorTable
Returns:
list of SqlOperator objects