ModSQL
Class Operator

java.lang.Object
  |
  +--ModSQL.AbstractFunction
        |
        +--ModSQL.Operator
All Implemented Interfaces:
Function
Direct Known Subclasses:
Operator_Add, Operator_Compare, Operator_Concat, Operator_Divide, Operator_Exists, Operator_In, Operator_Is, Operator_Like, Operator_Logical, Operator_Multiply, Operator_Negate, Operator_Not

public abstract class Operator
extends AbstractFunction

Abstract implementation of Function to simplify the implementation of operators.

Author:
chris.studholme@utoronto.ca

Fields inherited from class ModSQL.AbstractFunction
all_constant, constant_non_null, evaluate_order, evaluate_order_array, out_of_order, parameter_constant, parameter_value, parameters, parameters_array
 
Fields inherited from interface ModSQL.Function
MATCH_BEGINS, MATCH_EQU, MATCH_GT, MATCH_GTE, MATCH_LT, MATCH_LTE, MATCH_NE
 
Constructor Summary
Operator()
           
 
Method Summary
 void addAllParameters(Function x)
          Add all of x's parameters to this function.
 void addAllParametersNegate(Function x)
          Add all of x's parameters to this function but apply the negation operator to each before adding them.
 void addAllParametersNot(Function x)
          Add all of x's parameters to this function but apply the NOT operator to each before adding them.
static Function removeDoubleNegation(Function x)
          Remove all instances of double negation operators if x is an Operator_Negate object.
static Function removeDoubleNot(Function x)
          Remove all instances of double NOT operators if x is an Operator_Not object.
 
Methods inherited from class ModSQL.AbstractFunction
addParameter, convertToSQLType, evaluate, evaluateConstantParameters, evaluateOrder, evaluateParameters, evaluateParameters, functionName, getCompatableType, getObjectSQLType, getParameter, getParameterCount, isAggregate, isConstant, optimize, postfixParameters, prefixParameters, registerWith, reset, toString
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 
Methods inherited from interface ModSQL.Function
evaluate, getMaxResultSize, getSQLType
 

Constructor Detail

Operator

public Operator()
Method Detail

removeDoubleNot

public static Function removeDoubleNot(Function x)
Remove all instances of double NOT operators if x is an Operator_Not object. Otherwise, this method just returns x.
Parameters:
x - function to check for double NOT
Returns:
either x or x with all double NOT's removed

removeDoubleNegation

public static Function removeDoubleNegation(Function x)
Remove all instances of double negation operators if x is an Operator_Negate object. Otherwise, this method just returns x.
Parameters:
x - function to check for double negation
Returns:
either x or x with all double negation removed

addAllParameters

public void addAllParameters(Function x)
                      throws SQLException
Add all of x's parameters to this function.
Parameters:
x - function who's parameters are to be added
Throws:
SQLException - if an error occurs

addAllParametersNot

public void addAllParametersNot(Function x)
                         throws SQLException
Add all of x's parameters to this function but apply the NOT operator to each before adding them.
Parameters:
x - function who's parameters are to be added
Throws:
SQLException - if an error occurs

addAllParametersNegate

public void addAllParametersNegate(Function x)
                            throws SQLException
Add all of x's parameters to this function but apply the negation operator to each before adding them.
Parameters:
x - function who's parameters are to be added
Throws:
SQLException - if an error occurs