net.sf.saffron.sql
Class SqlOperatorTable

java.lang.Object
  |
  +--net.sf.saffron.sql.SqlOperatorTable
Direct Known Subclasses:
RexOperatorTable

public class SqlOperatorTable
extends Object

SqlOperatorTable is a singleton which contains an instance of each operator.


Field Summary
 SqlBinaryOperator andOperator
           
 SqlBinaryOperator asOperator
           
static SqlOperator.TypeInference booleanType
          Type-inference strategy whereby the result type of a call is Boolean.
 SqlFunction cast
          The SQL CAST operator.
 SqlBinaryOperator concatOperator
           
 SqlSpecialOperator deleteOperator
           
 SqlPostfixOperator descendingOperator
           
 SqlBinaryOperator divideOperator
           
 SqlBinaryOperator dotOperator
           
 SqlBinaryOperator equalsOperator
           
 SqlBinaryOperator exceptOperator
           
 SqlPrefixOperator existsOperator
           
 SqlSpecialOperator explainOperator
           
 SqlBinaryOperator greaterThanOperator
           
 SqlBinaryOperator greaterThanOrEqualOperator
           
 SqlBinaryOperator inOperator
           
 SqlSpecialOperator insertOperator
           
private static SqlOperatorTable instance
           
 SqlBinaryOperator intersectOperator
           
 SqlPostfixOperator isNotNullOperator
           
 SqlPostfixOperator isNullOperator
           
 SqlJoinOperator joinOperator
           
 SqlBinaryOperator lessThanOperator
           
 SqlBinaryOperator lessThanOrEqualOperator
           
private  HashMap mapNameToOp
           
 SqlBinaryOperator minusOperator
           
 SqlBinaryOperator multiplyOperator
           
 SqlBinaryOperator notEqualsOperator
           
 SqlPrefixOperator notOperator
           
private  MultiMap operators
           
 SqlBinaryOperator orOperator
           
 SqlBinaryOperator plusOperator
           
 SqlPrefixOperator prefixMinusOperator
           
 SqlPrefixOperator prefixPlusOperator
           
 SqlFunction rowConstructor
           
 SqlSelectOperator selectOperator
           
 SqlFunction substringFunction
           
 SqlBinaryOperator unionOperator
           
static SqlOperator.TypeInference useFirstArgType
          Type-inference strategy whereby the result type of a call is the type of the first operand.
static SqlOperator.TypeInference useScope
          Type-inference strategy where the expression is assumed to be registered as a SqlValidator.Scope, and therefore the result type of the call is the type of that scope.
 SqlPrefixOperator valuesOperator
           
 
Constructor Summary
protected SqlOperatorTable()
           
 
Method Summary
static SqlOperatorTable instance()
          Retrieves the singleton, creating it if necessary.
 SqlOperator lookup(SqlKind kind)
          Retrieves an operator by its id.
 SqlOperator lookup(String opName, int syntax)
          Retrieves an operator by its name and syntactic type.
 void register(SqlOperator op)
           
 SqlNode toTree(List list)
          Converts a list of {expression, operator, expression, ...} into a tree, taking operator precedence and associativity into account.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instance

private static SqlOperatorTable instance

useFirstArgType

public static final SqlOperator.TypeInference useFirstArgType
Type-inference strategy whereby the result type of a call is the type of the first operand.


booleanType

public static final SqlOperator.TypeInference booleanType
Type-inference strategy whereby the result type of a call is Boolean.


useScope

public static final SqlOperator.TypeInference useScope
Type-inference strategy where the expression is assumed to be registered as a SqlValidator.Scope, and therefore the result type of the call is the type of that scope.


andOperator

public final SqlBinaryOperator andOperator

asOperator

public final SqlBinaryOperator asOperator

concatOperator

public final SqlBinaryOperator concatOperator

divideOperator

public final SqlBinaryOperator divideOperator

dotOperator

public final SqlBinaryOperator dotOperator

equalsOperator

public final SqlBinaryOperator equalsOperator

exceptOperator

public final SqlBinaryOperator exceptOperator

greaterThanOperator

public final SqlBinaryOperator greaterThanOperator

greaterThanOrEqualOperator

public final SqlBinaryOperator greaterThanOrEqualOperator

inOperator

public final SqlBinaryOperator inOperator

intersectOperator

public final SqlBinaryOperator intersectOperator

lessThanOperator

public final SqlBinaryOperator lessThanOperator

lessThanOrEqualOperator

public final SqlBinaryOperator lessThanOrEqualOperator

minusOperator

public final SqlBinaryOperator minusOperator

multiplyOperator

public final SqlBinaryOperator multiplyOperator

notEqualsOperator

public final SqlBinaryOperator notEqualsOperator

orOperator

public final SqlBinaryOperator orOperator

plusOperator

public final SqlBinaryOperator plusOperator

unionOperator

public final SqlBinaryOperator unionOperator

substringFunction

public final SqlFunction substringFunction

rowConstructor

public final SqlFunction rowConstructor

cast

public final SqlFunction cast
The SQL CAST operator.

The target type is simply stored as the return type, not an explicit operand. For example, the expression CAST(1 + 2 AS DOUBLE) will become a call to CAST with the expression 1 + 2 as its only operand.


descendingOperator

public final SqlPostfixOperator descendingOperator

isNotNullOperator

public final SqlPostfixOperator isNotNullOperator

isNullOperator

public final SqlPostfixOperator isNullOperator

existsOperator

public final SqlPrefixOperator existsOperator

notOperator

public final SqlPrefixOperator notOperator

prefixMinusOperator

public final SqlPrefixOperator prefixMinusOperator

prefixPlusOperator

public final SqlPrefixOperator prefixPlusOperator

valuesOperator

public final SqlPrefixOperator valuesOperator

selectOperator

public final SqlSelectOperator selectOperator

joinOperator

public final SqlJoinOperator joinOperator

insertOperator

public final SqlSpecialOperator insertOperator

deleteOperator

public final SqlSpecialOperator deleteOperator

explainOperator

public final SqlSpecialOperator explainOperator

operators

private final MultiMap operators

mapNameToOp

private final HashMap mapNameToOp
Constructor Detail

SqlOperatorTable

protected SqlOperatorTable()
Method Detail

instance

public static SqlOperatorTable instance()
Retrieves the singleton, creating it if necessary.


lookup

public SqlOperator lookup(String opName,
                          int syntax)
Retrieves an operator by its name and syntactic type.


register

public void register(SqlOperator op)

toTree

public SqlNode toTree(List list)
Converts a list of {expression, operator, expression, ...} into a tree, taking operator precedence and associativity into account.

Pre-condition:
list.size() % 2 == 1

lookup

public SqlOperator lookup(SqlKind kind)
Retrieves an operator by its id.


SourceForge.net_Logo