org.eigenbase.sql.util
Class ChainedSqlOperatorTable

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

public class ChainedSqlOperatorTable
extends Object
implements SqlOperatorTable

ChainedSqlOperatorTable implements the SqlOperatorTable interface by chaining together any number of underlying operator table instances.

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

Field Summary
private  List<SqlOperatorTable> tableList
           
 
Constructor Summary
ChainedSqlOperatorTable()
          Creates a new empty table.
 
Method Summary
 void add(SqlOperatorTable table)
          Adds an underlying table.
 List<SqlOperator> getOperatorList()
          Retrieves a list of all functions and operators in this table.
 List<SqlOperator> lookupOperatorOverloads(SqlIdentifier opName, SqlFunctionCategory category, SqlSyntax syntax)
          Retrieves a list of operators with a given name and syntax.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tableList

private final List<SqlOperatorTable> tableList
Constructor Detail

ChainedSqlOperatorTable

public ChainedSqlOperatorTable()
Creates a new empty table.

Method Detail

add

public void add(SqlOperatorTable table)
Adds an underlying table. The order in which tables are added is significant; tables added earlier have higher lookup precedence. A table is not added if it is already on the list.

Parameters:
table - table to add

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)

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