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

pack-priv Class IsNode

extends BinaryLogicalOperatorNode
Class Inheritance
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.classfile.VMOpcode, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode:
shortCircuitValue

Constructor Summary

AccessConstructor and Description
pack-priv
IsNode(ValueNode
The left operand of the IS
leftOperand
,
ValueNode
The right operand of the IS
rightOperand
,
boolean
Whether to reverse the sense of this node.
notMe
,
ContextManager
The context manager
cm
)

Constructor for an IsNode

Method Summary

Modifier and TypeMethod and Description
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.BinaryLogicalOperatorNode.bindExpression.

Bind this logical operator.

public ValueNode

Returns:

The modified expression
changeToCNF
(boolean
Whether or not we are under a top level AndNode.
underTopAndNode
)

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

Finish putting an expression into conjunctive normal form.

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.

pack-priv void
generateExpression(ExpressionClassBuilder
The ExpressionClassBuilder for the class we're generating
acb
,
MethodBuilder
the method the expression will go into
mb
)

Overrides org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.generateExpression.

Do code generation for this logical binary operator.

public ValueNode

Returns:

The modified expression
putAndsOnTop
()

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

Do the 1st step in putting child expressions into conjunctive normal form.

public boolean

Returns:

Boolean which reflects validity of the tree.
verifyChangeToCNF
()

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

Verify that changeToCNF() did its job correctly.

public boolean

Returns:

Boolean which reflects validity of the tree.
verifyPutAndsOnTop
()

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

Verify that putAndsOnTop() did its job correctly.

Inherited from org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode:
resolveLogicalBinaryOperatorverifyEliminateNots

Field Detail

notMeback to summary
private boolean notMe

Constructor Detail

IsNodeback to summary
pack-priv IsNode(ValueNode leftOperand, ValueNode rightOperand, boolean notMe, ContextManager cm)

Constructor for an IsNode

Parameters
leftOperand:ValueNode

The left operand of the IS

rightOperand:ValueNode

The right operand of the IS

notMe:boolean

Whether to reverse the sense of this node.

cm:ContextManager

The context manager

Method Detail

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

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

Bind this logical operator. All that has to be done for binding a logical operator is to bind the operands, check that both operands are BooleanDataValue, and set the result type to BooleanDataValue.

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.

Exceptions
StandardException:
Thrown on error
changeToCNFback to summary
public ValueNode changeToCNF(boolean underTopAndNode) throws StandardException

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

Finish putting an expression into conjunctive normal form. An expression tree in conjunctive normal form meets the following criteria: o If the expression tree is not null, the top level will be a chain of AndNodes terminating in a true BooleanConstantNode. o The left child of an AndNode will never be an AndNode. o Any right-linked chain that includes an AndNode will be entirely composed of AndNodes terminated by a true BooleanConstantNode. o The left child of an OrNode will never be an OrNode. o Any right-linked chain that includes an OrNode will be entirely composed of OrNodes terminated by a false BooleanConstantNode. o ValueNodes other than AndNodes and OrNodes are considered leaf nodes for purposes of expression normalization. In other words, we won't do any normalization under those nodes. In addition, we track whether or not we are under a top level AndNode. SubqueryNodes need to know this for subquery flattening.

Parameters
underTopAndNode:boolean

Whether or not we are under a top level AndNode.

Returns:ValueNode

The modified expression

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 just mark whether this IS node is under an eliminated NOT node.

Parameters
underNotNode:boolean

Whether or not we are under a NotNode.

Returns:ValueNode

The modified expression

Exceptions
StandardException:
Thrown on error
generateExpressionback to summary
pack-priv void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

Overrides org.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode.generateExpression.

Do code generation for this logical binary operator.

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class we're generating

mb:MethodBuilder

the method the expression will go into

Exceptions
StandardException:
Thrown on error
putAndsOnTopback to summary
public ValueNode putAndsOnTop() throws StandardException

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

Do the 1st step in putting child expressions into conjunctive normal form. This step ensures that the top level of the child expression is a chain of AndNodes terminated by a true BooleanConstantNode.

Returns:ValueNode

The modified expression

Exceptions
StandardException:
Thrown on error
verifyChangeToCNFback to summary
public boolean verifyChangeToCNF()

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

Verify that changeToCNF() did its job correctly. Verify that: o AndNode - rightOperand is not instanceof OrNode leftOperand is not instanceof AndNode o OrNode - rightOperand is not instanceof AndNode leftOperand is not instanceof OrNode

Returns:boolean

Boolean which reflects validity of the tree.

verifyPutAndsOnTopback to summary
public boolean verifyPutAndsOnTop()

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

Verify that putAndsOnTop() did its job correctly. Verify that the top level of the expression is a chain of AndNodes terminated by a true BooleanConstantNode.

Returns:boolean

Boolean which reflects validity of the tree.