|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.BinaryOperatorNode
org.apache.derby.impl.sql.compile.BinaryComparisonOperatorNode
public abstract class BinaryComparisonOperatorNode
This node is the superclass for all binary comparison operators, such as =, <>, <, etc.
Field Summary | |
---|---|
private boolean |
betweenSelectivity
|
private boolean |
forQueryRewrite
|
Fields inherited from class org.apache.derby.impl.sql.compile.BinaryOperatorNode |
---|
AND, BinaryArgTypes, BinaryMethodNames, BinaryOperators, BinaryResultTypes, CONCATENATE, DIVIDE, EQ, GE, GT, LE, leftInterfaceType, leftOperand, LIKE, LT, methodName, MINUS, NE, operator, operatorType, OR, PLUS, receiver, resultInterfaceType, rightInterfaceType, rightOperand, TIMES, XMLEXISTS_OP, XMLQUERY_OP |
Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode |
---|
transformed |
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
---|
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired |
Constructor Summary | |
---|---|
BinaryComparisonOperatorNode()
|
Method Summary | |
---|---|
void |
bindComparisonOperator()
Test the type compatability of the operands and set the type info for this node. |
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this comparison operator. |
ValueNode |
changeToCNF(boolean underTopAndNode)
Finish putting an expression into conjunctive normal form. |
(package private) ValueNode |
eliminateNots(boolean underNotNode)
Eliminate NotNodes in the current query block. |
ValueNode |
genSQLJavaSQLTree()
generate a SQL->Java->SQL conversion tree above the left and right operand of this Binary Operator Node if needed. |
(package private) boolean |
getBetweenSelectivity()
Return whether or not to use the between selectivity for this node. |
boolean |
getForQueryRewrite()
Was this node generated in a query rewrite? |
(package private) abstract BinaryOperatorNode |
getNegation(ValueNode leftOperand,
ValueNode rightOperand)
Negate the comparison. |
(package private) abstract BinaryOperatorNode |
getSwappedEquivalent()
Return a node equivalent to this node, but with the left and right operands swapped. |
void |
init(java.lang.Object leftOperand,
java.lang.Object rightOperand,
java.lang.Object operator,
java.lang.Object methodName)
Initializer for a BinaryComparisonOperatorNode |
ValueNode |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
Preprocess an expression tree. |
(package private) void |
setBetweenSelectivity()
Use between selectivity when calculating the selectivity. |
void |
setForQueryRewrite(boolean val)
This node was generated as part of a query rewrite. |
Methods inherited from class org.apache.derby.impl.sql.compile.BinaryOperatorNode |
---|
acceptChildren, bindXMLQuery, categorize, constantExpression, generateExpression, getLeftOperand, getOrderableVariantType, getReceiverInterfaceName, getRightOperand, init, init, initializeResultField, isConstantExpression, isEquivalent, printSubNodes, remapColumnReferencesToExpressions, setLeftOperand, setLeftRightInterfaceType, setMethodName, setOperator, setRightOperand, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean forQueryRewrite
private boolean betweenSelectivity
Constructor Detail |
---|
public BinaryComparisonOperatorNode()
Method Detail |
---|
public void init(java.lang.Object leftOperand, java.lang.Object rightOperand, java.lang.Object operator, java.lang.Object methodName)
init
in class BinaryOperatorNode
leftOperand
- The left operand of the comparisonrightOperand
- The right operand of the comparisonoperator
- The name of the operatormethodName
- The name of the method to call in the generated
classpublic void setForQueryRewrite(boolean val)
val
- true if this was for a query rewritepublic boolean getForQueryRewrite()
void setBetweenSelectivity()
boolean getBetweenSelectivity()
public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector) throws StandardException
bindExpression
in class BinaryOperatorNode
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate vector being built as we find AggregateNodes
StandardException
- Thrown on errorpublic void bindComparisonOperator() throws StandardException
StandardException
- Thrown on errorpublic ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
preprocess
in class BinaryOperatorNode
numTables
- Number of tables in the DML StatementouterFromList
- FromList from outer query blockouterSubqueryList
- SubqueryList from outer query blockouterPredicateList
- PredicateList from outer query block
StandardException
- Thrown on errorValueNode eliminateNots(boolean underNotNode) throws StandardException
eliminateNots
in class ValueNode
underNotNode
- Whether or not we are under a NotNode.
StandardException
- Thrown on errorabstract BinaryOperatorNode getNegation(ValueNode leftOperand, ValueNode rightOperand) throws StandardException
leftOperand
- The left operand of the comparison operatorrightOperand
- The right operand of the comparison operator
StandardException
- Thrown on errorabstract BinaryOperatorNode getSwappedEquivalent() throws StandardException
Return a node equivalent to this node, but with the left and right operands swapped. The node type may also be changed if the operator is not symmetric.
This method may for instance be used to normalize a predicate by
moving constants to the right-hand side of the comparison. Example:
1 = A
will be transformed to A = 1
, and 10 < B
will be transformed to B > 10
.
StandardException
- if an error occurspublic ValueNode changeToCNF(boolean underTopAndNode) throws StandardException
changeToCNF
in class ValueNode
underTopAndNode
- Whether or not we are under a top level AndNode.
StandardException
- Thrown on errorpublic ValueNode genSQLJavaSQLTree() throws StandardException
BinaryOperatorNode
genSQLJavaSQLTree
in class BinaryOperatorNode
StandardException
- Thrown on errorBinaryOperatorNode.genSQLJavaSQLTree()
|
Built on Thu 2011-03-10 11:54:14+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |