|
||||||||||
| 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.TernaryOperatorNode
A TernaryOperatorNode represents a built-in ternary operators. This covers built-in functions like substr(). Java operators are not represented here: the JSQL language allows Java methods to be called from expressions, but not Java operators.
| Field Summary | |
(package private) java.lang.String |
leftInterfaceType
|
(package private) ValueNode |
leftOperand
|
static int |
LIKE
|
static int |
LOCATE
|
(package private) java.lang.String |
methodName
|
(package private) java.lang.String |
operator
|
(package private) int |
operatorType
|
(package private) ValueNode |
receiver
|
(package private) java.lang.String |
receiverInterfaceType
|
(package private) java.lang.String |
resultInterfaceType
|
(package private) java.lang.String |
rightInterfaceType
|
(package private) ValueNode |
rightOperand
|
static int |
SUBSTRING
|
(package private) static java.lang.String[][] |
TernaryArgType
|
(package private) static java.lang.String[] |
TernaryMethodNames
|
(package private) static java.lang.String[] |
TernaryOperators
|
(package private) static java.lang.String[] |
TernaryResultType
|
static int |
TIMESTAMPADD
|
static int |
TIMESTAMPDIFF
|
static int |
TRIM
|
(package private) int |
trimType
|
| 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 | |
TernaryOperatorNode()
|
|
| Method Summary | |
Visitable |
accept(Visitor v)
Accept a visitor, and call v.visit() on child nodes as necessary. |
private void |
bindDateTimeArg(ValueNode arg,
int argNumber)
|
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this expression. |
private boolean |
bindParameter(ValueNode arg,
int jdbcType)
|
protected void |
bindToBuiltIn()
|
protected ValueNode |
castArgToString(ValueNode vn)
|
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 ternary operator. |
ValueNode |
getLeftOperand()
Get the leftOperand |
ValueNode |
getReceiver()
|
ValueNode |
getRightOperand()
Get the rightOperand |
private DataTypeDescriptor |
getVarcharDescriptor()
|
void |
init(java.lang.Object receiver,
java.lang.Object leftOperand,
java.lang.Object rightOperand,
java.lang.Object operatorType,
java.lang.Object trimType)
Initializer for a TernaryOperatorNode |
boolean |
isConstantExpression()
Return whether or not this expression tree represents a constant expression. |
ValueNode |
locateBind()
Bind locate operator |
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. |
void |
setLeftOperand(ValueNode newLeftOperand)
Set the leftOperand to the specified ValueNode |
private void |
setResultType(TypeId resultType)
|
void |
setRightOperand(ValueNode newRightOperand)
Set the rightOperand to the specified ValueNode |
ValueNode |
substrBind()
Bind substr expression. |
private void |
throwBadType(java.lang.String funcName,
java.lang.String type)
|
private ValueNode |
timestampAddBind()
Bind TIMESTAMPADD expression. |
private ValueNode |
timestampDiffBind()
Bind TIMESTAMPDIFF expression. |
java.lang.String |
toString()
Convert this object to a String. |
private ValueNode |
trimBind()
Bind trim expression. |
| 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
ValueNode receiver
ValueNode leftOperand
ValueNode rightOperand
java.lang.String resultInterfaceType
java.lang.String receiverInterfaceType
java.lang.String leftInterfaceType
java.lang.String rightInterfaceType
int trimType
public static final int TRIM
public static final int LOCATE
public static final int SUBSTRING
public static final int LIKE
public static final int TIMESTAMPADD
public static final int TIMESTAMPDIFF
static final java.lang.String[] TernaryOperators
static final java.lang.String[] TernaryMethodNames
static final java.lang.String[] TernaryResultType
static final java.lang.String[][] TernaryArgType
| Constructor Detail |
public TernaryOperatorNode()
| Method Detail |
public void init(java.lang.Object receiver,
java.lang.Object leftOperand,
java.lang.Object rightOperand,
java.lang.Object operatorType,
java.lang.Object trimType)
init in class ValueNodereceiver - The receiver (eg, string being operated on in substr())leftOperand - The left operand of the noderightOperand - The right operand of the nodeoperatorType - The type of the operandtrimType - The maximum width of this new node
public java.lang.String toString()
toString in class ValueNodepublic void setClause(int clause)
setClause in class ValueNodeclause - The clause that this node appears in.
public void printSubNodes(int depth)
printSubNodes in class QueryTreeNodedepth - The depth of this node in the tree
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
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 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 errorpublic void setLeftOperand(ValueNode newLeftOperand)
newLeftOperand - The new leftOperand
public ValueNode getLeftOperand()
public void setRightOperand(ValueNode newRightOperand)
newRightOperand - The new rightOperand
public ValueNode getRightOperand()
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)
public Visitable accept(Visitor v)
throws StandardException
accept in interface Visitableaccept in class QueryTreeNodev - the visitor
StandardException - on error
private ValueNode trimBind()
throws StandardException
StandardException - Thrown on error
private void setResultType(TypeId resultType)
throws StandardException
StandardException
public ValueNode locateBind()
throws StandardException
StandardException - Thrown on error
protected ValueNode castArgToString(ValueNode vn)
throws StandardException
StandardException
public ValueNode substrBind()
throws StandardException
StandardException - Thrown on error
private ValueNode timestampAddBind()
throws StandardException
StandardException - Thrown on error
private ValueNode timestampDiffBind()
throws StandardException
StandardException - Thrown on error
private void bindDateTimeArg(ValueNode arg,
int argNumber)
throws StandardException
StandardException
private boolean bindParameter(ValueNode arg,
int jdbcType)
throws StandardException
StandardExceptionpublic ValueNode getReceiver()
private void throwBadType(java.lang.String funcName,
java.lang.String type)
throws StandardException
StandardException
protected void bindToBuiltIn()
throws StandardException
StandardExceptionprivate DataTypeDescriptor getVarcharDescriptor()
|
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 | |||||||||