ModSQL
Class Operator_Negate
java.lang.Object
|
+--ModSQL.AbstractFunction
|
+--ModSQL.Operator
|
+--ModSQL.Operator_Negate
- All Implemented Interfaces:
- Function
- final class Operator_Negate
- extends Operator
SQL operator "-".
- Author:
- chris.studholme@utoronto.ca
| Methods inherited from class ModSQL.AbstractFunction |
addParameter, convertToSQLType, evaluateConstantParameters, evaluateOrder, evaluateParameters, evaluateParameters, getCompatableType, getObjectSQLType, getParameter, getParameterCount, isAggregate, isConstant, postfixParameters, prefixParameters, registerWith, reset, toString |
| Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait |
Operator_Negate
public Operator_Negate()
- Default constructor.
Operator_Negate
public Operator_Negate(Function parameter)
throws SQLException
- Constructor with parameter.
- Parameters:
parameter - first (and only) parameter- Throws:
SQLException - if there is an error with the parameter
optimize
public void optimize()
throws SQLException
Prepare the function for use.
- Overrides:
optimize in class AbstractFunction
- Throws:
SQLException - if the parameter is invalid
functionName
public String functionName()
- Returns "#NEGATE".
- Overrides:
functionName in class AbstractFunction
- Returns:
- name of function
getSQLType
public int getSQLType()
throws SQLException
- Returns the type of the parameter.
- Returns:
- SQL type of data to be returned
- Throws:
SQLException - if a database-access error occurs.
getMaxResultSize
public int getMaxResultSize()
- Returns -1 as this operator will never return a String object.
- Returns:
- maximum size of String returned or -1 if unknown
evaluate
public Object evaluate(boolean aggregate)
throws SQLException,
EndOfTable
- Evaluate parameter and negate.
- Parameters:
aggregate - passed to parameter- Returns:
- result object
- Throws:
SQLException - if a database-access error occursEndOfTable - if thrown by a parameter
evaluate
public Object evaluate(int match_op,
Object match_value)
throws SQLException,
EndOfTable
- Evaluate parameter and negate.
- Overrides:
evaluate in class AbstractFunction
- Parameters:
match_op - how the value should be matchedmatch_value - desired value- Returns:
- result object
- Throws:
SQLException - if a database-access error occursEndOfTable - if thrown by a parameter