|
||||||||||
| 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.UnaryOperatorNode
A UnaryOperatorNode represents a built-in unary operator as defined by the ANSI/ISO SQL standard. This covers operators like +, -, NOT, and IS NULL. Java operators are not represented here: the JSQL language allows Java methods to be called from expressions, but not Java operators.
| Field Summary | |
private java.lang.Object[] |
additionalArgs
|
static int |
IS_NULL
|
(package private) java.lang.String |
methodName
|
static int |
NOT
|
(package private) ValueNode |
operand
WARNING: operand may be NULL for COUNT(*). |
(package private) java.lang.String |
operator
|
(package private) int |
operatorType
|
(package private) java.lang.String |
receiverInterfaceType
|
(package private) java.lang.String |
resultInterfaceType
|
static int |
UNARY_MINUS
|
static int |
UNARY_PLUS
|
(package private) static java.lang.String[] |
UnaryArgTypes
|
(package private) static java.lang.String[] |
UnaryMethodNames
|
(package private) static java.lang.String[] |
UnaryOperators
|
(package private) static java.lang.String[] |
UnaryResultTypes
|
static int |
XMLPARSE_OP
|
static int |
XMLSERIALIZE_OP
|
| Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode |
clause, dataTypeServices, IN_HAVING_CLAUSE, IN_SELECT_LIST, IN_UNKNOWN_CLAUSE, IN_WHERE_CLAUSE, transformed |
| Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode |
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset |
| Constructor Summary | |
UnaryOperatorNode()
|
|
| Method Summary | |
Visitable |
accept(Visitor v)
Accept a visitor, and call v.visit() on child nodes as necessary. |
protected int |
addMethodParams(MethodBuilder mb)
This method allows different operators to add primitive arguments to the generated method call, if needed. |
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this expression. |
(package private) void |
bindParameter()
By default unary operators don't accept ? |
protected ValueNode |
bindUnaryOperator(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Workhorse for bindExpression. |
void |
bindXMLParse()
Bind an XMLPARSE operator. |
void |
bindXMLSerialize()
Bind an XMLSERIALIZE operator. |
boolean |
categorize(JBitSet referencedTabs,
boolean simplePredsOnly)
Categorize this predicate. |
boolean |
constantExpression(PredicateList whereClause)
Return whether or not this expression tree represents a constant value. |
void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
Do code generation for this unary operator. |
ValueNode |
getOperand()
Get the operand of this unary operator. |
(package private) java.lang.String |
getOperatorString()
Get the operator of this unary operator. |
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression. |
java.lang.String |
getReceiverInterfaceName()
Determine the type the binary method is called on. |
void |
init(java.lang.Object operand)
Initializer for a UnaryOperatorNode |
void |
init(java.lang.Object operand,
java.lang.Object operatorOrOpType,
java.lang.Object methodNameOrAddedArgs)
Initializer for a UnaryOperatorNode |
boolean |
isConstantExpression()
Return whether or not this expression tree represents a constant expression. |
ValueNode |
preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
Preprocess an expression tree. |
void |
printSubNodes(int depth)
Prints the sub-nodes of this object. |
ValueNode |
remapColumnReferencesToExpressions()
Remap all ColumnReferences in this tree to be clones of the underlying expression. |
void |
setClause(int clause)
Set the clause that this node appears in. |
(package private) void |
setMethodName(java.lang.String methodName)
Set the methodName. |
(package private) void |
setOperator(java.lang.String operator)
Set the operator. |
java.lang.String |
toString()
Convert this object to a String. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
java.lang.String operator
java.lang.String methodName
int operatorType
java.lang.String resultInterfaceType
java.lang.String receiverInterfaceType
ValueNode operand
public static final int UNARY_PLUS
public static final int UNARY_MINUS
public static final int NOT
public static final int IS_NULL
public static final int XMLPARSE_OP
public static final int XMLSERIALIZE_OP
static final java.lang.String[] UnaryOperators
static final java.lang.String[] UnaryMethodNames
static final java.lang.String[] UnaryResultTypes
static final java.lang.String[] UnaryArgTypes
private java.lang.Object[] additionalArgs
| Constructor Detail |
public UnaryOperatorNode()
| Method Detail |
public void init(java.lang.Object operand,
java.lang.Object operatorOrOpType,
java.lang.Object methodNameOrAddedArgs)
init in class QueryTreeNodeoperand - The operand of the nodeoperatorOrOpType - Either 1) the name of the operator,
OR 2) an Integer holding the operatorType for this operator.public void init(java.lang.Object operand)
init in class QueryTreeNodeoperand - The operand of the nodevoid setOperator(java.lang.String operator)
operator - The operator.
java.lang.String getOperatorString()
void setMethodName(java.lang.String methodName)
methodName - The methodName.
public java.lang.String toString()
toString in class ValueNodepublic void printSubNodes(int depth)
printSubNodes in class QueryTreeNodedepth - The depth of this node in the tree
public ValueNode getOperand()
public void setClause(int clause)
setClause in class ValueNodeclause - The clause that this node appears in.
public ValueNode bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
throws StandardException
bindExpression in class ValueNodefromList - The FROM list for the query this
expression is in, for binding columns.subqueryList - The subquery list being built as we find SubqueryNodesaggregateVector - The aggregate vector being built as we find AggregateNodes
StandardException - Thrown on error
protected ValueNode bindUnaryOperator(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
throws StandardException
StandardException
public void bindXMLParse()
throws StandardException
StandardException - Thrown on error
public void bindXMLSerialize()
throws StandardException
StandardException - Thrown on error
public ValueNode preprocess(int numTables,
FromList outerFromList,
SubqueryList outerSubqueryList,
PredicateList outerPredicateList)
throws StandardException
preprocess in class ValueNodenumTables - 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 error
public boolean categorize(JBitSet referencedTabs,
boolean simplePredsOnly)
throws StandardException
categorize in class ValueNodereferencedTabs - JBitSet with bit map of referenced FromTablessimplePredsOnly - Whether or not to consider method
calls, field references and conditional nodes
when building bit map
StandardException - Thrown on error
public ValueNode remapColumnReferencesToExpressions()
throws StandardException
remapColumnReferencesToExpressions in class ValueNodeStandardException - Thrown on errorpublic boolean isConstantExpression()
isConstantExpression in class ValueNodepublic boolean constantExpression(PredicateList whereClause)
ValueNode
constantExpression in class ValueNodeValueNode.constantExpression(org.apache.derby.impl.sql.compile.PredicateList)
void bindParameter()
throws StandardException
StandardException - Thrown if ? parameter doesn't
have a type bound to it yet.
? parameter where it isn't allowed.
public void generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
throws StandardException
generateExpression in class ValueNodeacb - The ExpressionClassBuilder for the class we're generatingmb - The method the expression will go into
StandardException - Thrown on error
public java.lang.String getReceiverInterfaceName()
throws StandardException
StandardException - Thrown on error
protected int getOrderableVariantType()
throws StandardException
getOrderableVariantType in class ValueNodeStandardException - thrown on error
public Visitable accept(Visitor v)
throws StandardException
accept in interface Visitableaccept in class QueryTreeNodev - the visitor
StandardException - on errorprotected int addMethodParams(MethodBuilder mb)
mb - The MethodBuilder that will make the call.
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||