Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

public abstract Class UnaryComparisonOperatorNode

extends UnaryOperatorNode
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.sql.compile.IsNullNode
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.compile.ExpressionClassBuilderInterface, .Optimizable, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, org.apache.derby.iapi.store.access.ScanController, org.apache.derby.iapi.types.DataTypeDescriptor, .TypeId, org.apache.derby.iapi.util.JBitSet

This node is the superclass for all unary comparison operators, such as is null and is not null.

Field Summary

Inherited from org.apache.derby.impl.sql.compile.UnaryOperatorNode:
K_BASEK_XMLPARSEK_XMLSERIALIZEkindmethodNameoperandoperatorreceiverInterfaceTyperesultInterfaceTypeUnaryArgTypesUnaryMethodNamesUnaryOperatorsUnaryResultTypes

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
bindComparisonOperator()

Set the type info for this node.

pack-priv ValueNode

Returns:

The new top of the expression tree.
bindExpression
(FromList
The query's FROM list
fromList
,
SubqueryList
The subquery list being built as we find SubqueryNodes
subqueryList
,
List<AggregateNode>
The aggregate list being built as we find AggregateNodes
aggregates
)

Overrides org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindExpression.

Bind this comparison operator.

pack-priv ValueNode

Returns:

The modified expression
eliminateNots
(boolean
Whether or not we are under a NotNode.
underNotNode
)

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

Eliminate NotNodes in the current query block.

public void
public void
public void
public void
public void
private int

Returns:

The absolute 0-based column position of the ColumnReference
getAbsoluteColumnPosition
(Optimizable
The Optimizable
optTable
)

Get the absolute 0-based column position of the ColumnReference from the conglomerate for this Optimizable.

public ColumnReference
getColumnOperand(Optimizable optTable, int columnPosition)

public ColumnReference
public ValueNode
getExpressionOperand(int tableNumber, int columnNumber, Optimizable ft)

pack-priv abstract UnaryOperatorNode

Returns:

BinaryOperatorNode The negated expression
getNegation
(ValueNode
The operand of the comparison operator
operand
)

Negate the comparison.

public ValueNode
getOperand(ColumnReference cRef, int refSetSize, boolean otherSide)

public int
public int
public int
public boolean
isQualifier(Optimizable optTable, boolean forPush)

public boolean
public boolean
Inherited from org.apache.derby.impl.sql.compile.UnaryOperatorNode:
acceptChildrenaddXmlOpMethodParamsbindOperandbindParametercategorizeconstantExpressiongenerateExpressiongetOperandgetOperatorStringgetOrderableVariantTypegetParameterOperandgetReceiverInterfaceNameisConstantExpressionisEquivalentisSameNodeKindpreprocessprintSubNodesremapColumnReferencesToExpressionssetMethodNamesetOperatortoString

Constructor Detail

UnaryComparisonOperatorNodeback to summary
pack-priv UnaryComparisonOperatorNode(ValueNode operator, ContextManager cm) throws StandardException

Method Detail

bindComparisonOperatorback to summary
pack-priv void bindComparisonOperator() throws StandardException

Set the type info for this node. This method is useful both during binding and when we generate nodes within the language module outside of the parser.

Exceptions
StandardException:
Thrown on error
bindExpressionback to summary
pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException

Overrides org.apache.derby.impl.sql.compile.UnaryOperatorNode.bindExpression.

Bind this comparison operator. All that has to be done for binding a comparison operator is to bind the operand and set the result type to SQLBoolean.

Parameters
fromList:FromList

The query's FROM list

subqueryList:SubqueryList

The subquery list being built as we find SubqueryNodes

aggregates:List<AggregateNode>

The aggregate list being built as we find AggregateNodes

Returns:ValueNode

The new top of the expression tree.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
eliminateNotsback to summary
pack-priv ValueNode eliminateNots(boolean underNotNode) throws StandardException

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

Eliminate NotNodes in the current query block. We traverse the tree, inverting ANDs and ORs and eliminating NOTs as we go. We stop at ComparisonOperators and boolean expressions. We invert ComparisonOperators and replace boolean expressions with boolean expression = false.

Note

Since we do not recurse under ComparisonOperators, there still could be NotNodes left in the tree.

Parameters
underNotNode:boolean

Whether or not we are under a NotNode.

Returns:ValueNode

The modified expression

Annotations
@Override
Exceptions
StandardException:
Thrown on error
generateAbsoluteColumnIdback to summary
public void generateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable)
See Also
RelationalOperator#generateAbsoluteColumnId
generateExpressionOperandback to summary
public void generateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilderInterface acbi, MethodBuilder mb) throws StandardException
Exceptions
StandardException:
Thrown on error
See Also
RelationalOperator#generateExpressionOperand
generateOrderedNullsback to summary
public void generateOrderedNulls(MethodBuilder mb)
See Also
RelationalOperator#generateOrderedNulls
generateQualMethodback to summary
public void generateQualMethod(ExpressionClassBuilderInterface acbi, MethodBuilder mb, Optimizable optTable) throws StandardException
Exceptions
StandardException:
Thrown on error
See Also
RelationalOperator#generateQualMethod
generateRelativeColumnIdback to summary
public void generateRelativeColumnId(MethodBuilder mb, Optimizable optTable)
See Also
RelationalOperator#generateRelativeColumnId
getAbsoluteColumnPositionback to summary
private int getAbsoluteColumnPosition(Optimizable optTable)

Get the absolute 0-based column position of the ColumnReference from the conglomerate for this Optimizable.

Parameters
optTable:Optimizable

The Optimizable

Returns:int

The absolute 0-based column position of the ColumnReference

getColumnOperandback to summary
public ColumnReference getColumnOperand(Optimizable optTable, int columnPosition)
See Also
RelationalOperator#getColumnOperand
getColumnOperandback to summary
public ColumnReference getColumnOperand(Optimizable optTable)
See Also
RelationalOperator#getColumnOperand
getExpressionOperandback to summary
public ValueNode getExpressionOperand(int tableNumber, int columnNumber, Optimizable ft)
See Also
RelationalOperator#getExpressionOperand
getNegationback to summary
pack-priv abstract UnaryOperatorNode getNegation(ValueNode operand) throws StandardException

Negate the comparison.

Parameters
operand:ValueNode

The operand of the comparison operator

Returns:UnaryOperatorNode

BinaryOperatorNode The negated expression

Exceptions
StandardException:
Thrown on error
getOperandback to summary
public ValueNode getOperand(ColumnReference cRef, int refSetSize, boolean otherSide)
See Also
RelationalOperator#getOperand
getOrderableVariantTypeback to summary
public int getOrderableVariantType(Optimizable optTable) throws StandardException
Exceptions
StandardException:
thrown on error
See Also
RelationalOperator#getOrderableVariantType
getStartOperatorback to summary
public int getStartOperator(Optimizable optTable)
See Also
RelationalOperator#getStartOperator
getStopOperatorback to summary
public int getStopOperator(Optimizable optTable)
See Also
RelationalOperator#getStopOperator
isQualifierback to summary
public boolean isQualifier(Optimizable optTable, boolean forPush)
See Also
RelationalOperator#isQualifier
orderedNullsback to summary
public boolean orderedNulls()
See Also
RelationalOperator#orderedNulls
selfComparisonback to summary
public boolean selfComparison(ColumnReference cr)
See Also
RelationalOperator#selfComparison