ModSQL
Class Operator_Is
java.lang.Object
|
+--ModSQL.AbstractFunction
|
+--ModSQL.Operator
|
+--ModSQL.Operator_Is
- All Implemented Interfaces:
- Function
- final class Operator_Is
- extends Operator
SQL operator IS.
- Author:
- chris.studholme@utoronto.ca
|
Field Summary |
private boolean |
is_not
True of IS NOT. |
private RowConstructor |
row
Row in case of row-constructor on LHS. |
private Object[] |
single_object
Single column row for use when we don't have a row-constructor. |
| 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 |
is_not
private boolean is_not
- True of IS NOT.
row
private RowConstructor row
- Row in case of row-constructor on LHS.
single_object
private Object[] single_object
- Single column row for use when we don't have a row-constructor.
Operator_Is
Operator_Is()
optimize
public void optimize()
throws SQLException
Prepare the function for use.
If the RHS parameter is a Function of type Operator_Not, it is
changed to the parameter of that operator and is_not is set to true.
- Overrides:
optimize in class AbstractFunction
- Throws:
SQLException - if the parameters are invalid
functionName
public String functionName()
- Returns "#IS".
- Overrides:
functionName in class AbstractFunction
- Returns:
- name of function
getSQLType
public int getSQLType()
- Returns Types.BIT.
- Returns:
- SQL type of data to be returned
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 parameters and compute the function.
- Parameters:
aggregate - passed to parameters- 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 parameters and compute the function.
- 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