org.apache.jdo.impl.jdoql.tree
Class Tree

java.lang.Object
  extended by antlr.BaseAST
      extended by antlr.CommonAST
          extended by org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
              extended by org.apache.jdo.impl.jdoql.tree.NodeImpl
                  extended by org.apache.jdo.impl.jdoql.tree.Tree
All Implemented Interfaces:
antlr.collections.AST, java.io.Serializable, java.lang.Cloneable, ExpressionFactory, Node, QueryTree

public final class Tree
extends NodeImpl
implements QueryTree, ExpressionFactory

This node represents the root of a query tree. You can use it to factorize this node's children, as there are candidate class, declarations, filter expression and ordering expressions.

Author:
Michael Watzek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
column, line, typeInfo
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
Tree()
          The noarg constructor is called by persistence manager internal.
Tree(CandidateClass candidateClass, ParameterDecl parameterDeclarations, VariableDecl variableDeclarations, OrderingExpr orderingExpressions, Expr filter)
          This constructor is called by semantic analysis only.
 
Method Summary
 void addAscendingOrdering(Expression expression)
          Adds an ascending ordering expression to this query tree.
 void addDescendingOrdering(Expression expression)
          Adds an descending ordering expression to this query tree.
 void arrive(NodeVisitor visitor)
          Delegates to the argument visitor.
protected  java.lang.Object clone()
          Creates and returns a copy of this object.
 void declareParameter(java.lang.Class clazz, java.lang.String parameter)
          Declares a parameter for this query tree.
 void declareVariable(java.lang.Class clazz, java.lang.String variable)
          Declares a variable for this query tree.
 java.lang.Class getCandidateClass()
          Returns the candidate class.
 Node[] getChildren()
          Returns the children of this node.
 java.util.Map getDeclaredParameters()
          Returns a map containing all declared parameters.
 java.util.List getDeclaredParametersAsList()
          Returns a list of all declared parameters.
 java.util.Map getDeclaredVariables()
          Returns a map containing all declared variables.
 Expression getFilter()
          Returns the filter expression of this query tree.
 java.util.List getOrderingExpressions()
          Returns a list of all added ordering expressions.
 java.lang.String getSerializedCandidateClassName()
          Returns the candidate class name calculated during serialization of this query tree instance.
 void initANTLRAST()
          Ensures that this node has a corresponding ANTLR tree structure.
 java.lang.Object leave(NodeVisitor visitor, java.lang.Object[] results)
          Delegates to the argument visitor.
 AndExpression newAnd(Expression left, Expression right)
          Returns an and expression for the arguments left and right.
 CastExpression newCast(java.lang.Class clazz, Expression expression)
          Returns an instance of CastExpression.
 ComplementExpression newComplement(Expression expr)
          Returns a complement expression for the argument expr.
 ConditionalAndExpression newConditionalAnd(Expression left, Expression right)
          Returns a conditional and expression for the arguments left and right.
 ConditionalOrExpression newConditionalOr(Expression left, Expression right)
          Returns a conditional or expression for the arguments left and right.
 ConstantExpression newConstant(boolean b)
          Returns an instance of BooleanLiteralExpression.
 ConstantExpression newConstant(byte b)
          Returns an instance of ByteLiteralExpression.
 ConstantExpression newConstant(char c)
          Returns an instance of CharLiteralExpression.
 ConstantExpression newConstant(double d)
          Returns an instance of DoubleLiteralExpression.
 ConstantExpression newConstant(float f)
          Returns an instance of FloatLiteralExpression.
 ConstantExpression newConstant(int i)
          Returns an instance of IntLiteralExpression.
 ConstantExpression newConstant(long l)
          Returns an instance of LongLiteralExpression.
 ConstantExpression newConstant(java.lang.Object value)
          Returns an instance of ConstantExpression.
 ConstantExpression newConstant(short s)
          Returns an instance of ShortLiteralExpression.
 DivideExpression newDivide(Expression left, Expression right)
          Returns a divide expression for the arguments left and right.
 EqualsExpression newEquals(Expression left, Expression right)
          Returns an equals expression for the arguments left and right.
 StaticFieldAccessExpression newFieldAccess(java.lang.Class clazz, java.lang.String fieldName)
          Returns an instance of StaticFieldAccessExpression.
 FieldAccessExpression newFieldAccess(Expression target, java.lang.String fieldName)
          Returns an instance of FieldAccessExpression.
 GreaterThanExpression newGreaterThan(Expression left, Expression right)
          Returns a greater than expression for the arguments left and right.
 GreaterThanEqualsExpression newGreaterThanEquals(Expression left, Expression right)
          Returns a greater than equals expression for the arguments left and right.
 IdentifierExpression newIdentifier(java.lang.String identifier)
          Returns an instance of either ThisExpression or VariableAccessExpression or ParameterAccessExpression or FieldAccessExpression depending on the fact which of the classes the argument identifier maps to.
 LessThanExpression newLessThan(Expression left, Expression right)
          Returns a less than expression for the arguments left and right.
 LessThanEqualsExpression newLessThanEquals(Expression left, Expression right)
          Returns a less than equals expression for the arguments left and right.
 MethodCallExpression newMethodCall(Expression target, java.lang.String methodName, Expression[] arguments)
          Returns an instance of MethodCallExpression.
 UnaryMinusExpression newMinus(Expression expr)
          Returns a unary minus expression for the argument expr.
 MinusExpression newMinus(Expression left, Expression right)
          Returns a minus expression for the arguments left and right.
 NotExpression newNot(Expression expr)
          Returns a not expression for the argument expr.
 NotEqualsExpression newNotEquals(Expression left, Expression right)
          Returns a not equals expression for the arguments left and right.
 OrExpression newOr(Expression left, Expression right)
          Returns an or expression for the arguments left and right.
 UnaryPlusExpression newPlus(Expression expr)
          Returns a plus expression for the argument expr.
 PlusExpression newPlus(Expression left, Expression right)
          Returns a plus expression for the arguments left and right.
 TimesExpression newTimes(Expression left, Expression right)
          Returns a times expression for the arguments left and right.
 void setCandidateClass(java.lang.Class clazz)
          Sets the candidate class for this query tree.
 void setFilter(Expression filter)
          Sets the filter expression for this query tree.
 boolean walkNextChild(NodeVisitor visitor, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
          Delegates to the argument visitor.
 
Methods inherited from class org.apache.jdo.impl.jdoql.tree.NodeImpl
getJavaClass, getObject, getParent, getTokenType, setObject, setParent, toString
 
Methods inherited from class org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
getColumn, getLine, getTypeInfo, initialize, initialize, initialize, setColumn, setLine, setTypeInfo, treeToString
 
Methods inherited from class antlr.CommonAST
getText, getType, initialize, setText, setType
 
Methods inherited from class antlr.BaseAST
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jdo.jdoql.tree.Node
getJavaClass, getObject, getParent, getTokenType, setObject, setParent
 

Constructor Detail

Tree

public Tree()
The noarg constructor is called by persistence manager internal.


Tree

public Tree(CandidateClass candidateClass,
            ParameterDecl parameterDeclarations,
            VariableDecl variableDeclarations,
            OrderingExpr orderingExpressions,
            Expr filter)
This constructor is called by semantic analysis only.

Parameters:
candidateClass - the candidate class
parameterDeclarations - the antlr node containing all parameter declaration nodes as siblings
variableDeclarations - the antlr node containing all variable declaration nodes as siblings
orderingExpressions - the antlr node containing all ordering nodes as siblings
filter - the filter expression
Method Detail

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

Overrides:
clone in class NodeImpl
Returns:
the copy
Throws:
java.lang.CloneNotSupportedException - thrown by super.clone()

setCandidateClass

public void setCandidateClass(java.lang.Class clazz)
Sets the candidate class for this query tree. This method throws NullPointerException if the argument clazz is null. Otherwise this method invalidates this tree: Parameters, variables, orderings and the filter are nullified.

Specified by:
setCandidateClass in interface QueryTree
Parameters:
clazz - the candidate class
Throws:
NullPointerException - if the argument clazz is null

declareParameter

public void declareParameter(java.lang.Class clazz,
                             java.lang.String parameter)
Declares a parameter for this query tree. This method throws NullPointerException if one of the arguments type or parameter are null. If a parameter is already declared having the same name as the argument parameter, then that declaration is replaced by this declaration. Once you have declared a parameter, you can access it using method newIdentifier. Please note: You can not declare a parameter and a variable having the same name.

Specified by:
declareParameter in interface QueryTree
Parameters:
clazz - the instance of a Java class which is the type of the declared parameter
parameter - the name of the declared parameter
Throws:
java.lang.NullPointerException - if type or parameter are null
JDOQueryException - if a variable has been declared with the same name

declareVariable

public void declareVariable(java.lang.Class clazz,
                            java.lang.String variable)
Declares a variable for this query tree. This method throws NullPointerException if one of the arguments type or variable are null. If a variable is already declared having the same name as the argument variable, then that declaration is replaced by this declaration. Once you have declared a variable, you can access it using method newIdentifier. Please note: You can not declare a parameter and a variable having the same name.

Specified by:
declareVariable in interface QueryTree
Parameters:
clazz - the instance of a Java class which is the type of the declared variable
variable - the name of the declared variable
Throws:
java.lang.NullPointerException - if type or variable are null
JDOQueryException - if a parameter has been declared with the same name

addAscendingOrdering

public void addAscendingOrdering(Expression expression)
Adds an ascending ordering expression to this query tree. This method throws NullPointerException if the argument expression is null. The order of adding ascending and descending ordering expressions defines the order of instances in the result collection of an executed query instance corresponding with this query tree.

Specified by:
addAscendingOrdering in interface QueryTree
Parameters:
expression - the order expression
Throws:
java.lang.NullPointerException - if expression is null

addDescendingOrdering

public void addDescendingOrdering(Expression expression)
Adds an descending ordering expression to this query tree. This method throws NullPointerException if the argument expression is null. The order of adding ascending and descending ordering expressions defines the order of instances in the result collection of an executed query instance corresponding with this query tree.

Specified by:
addDescendingOrdering in interface QueryTree
Parameters:
expression - the order expression
Throws:
java.lang.NullPointerException - if expression is null

setFilter

public void setFilter(Expression filter)
Sets the filter expression for this query tree. This method throws NullPointerException if the argument filter is null.

Specified by:
setFilter in interface QueryTree
Parameters:
filter - the filter expression
Throws:
java.lang.NullPointerException - if filter is null
JDOQueryException - if the result type of filter is a non boolean type

getCandidateClass

public java.lang.Class getCandidateClass()
Returns the candidate class.

Specified by:
getCandidateClass in interface QueryTree
Returns:
the candidate class

getDeclaredVariables

public java.util.Map getDeclaredVariables()
Returns a map containing all declared variables. This map contains variable names as keys and instances of VariableDeclaration as values.

Specified by:
getDeclaredVariables in interface QueryTree
Returns:
the map of declared variables

getDeclaredParameters

public java.util.Map getDeclaredParameters()
Returns a map containing all declared parameters. This map contains parameter names as keys and instances of ParameterDeclaration as values.

Specified by:
getDeclaredParameters in interface QueryTree
Returns:
the map of declared parameters

getDeclaredParametersAsList

public java.util.List getDeclaredParametersAsList()
Returns a list of all declared parameters. The order of entries is defined by the order of calls declareParameter. This list contains instances of ParametersDeclaration as entries.

Specified by:
getDeclaredParametersAsList in interface QueryTree
Returns:
the list of declared parameters

getFilter

public Expression getFilter()
Returns the filter expression of this query tree.

Specified by:
getFilter in interface QueryTree
Returns:
the filter or null.

getOrderingExpressions

public java.util.List getOrderingExpressions()
Returns a list of all added ordering expressions. The order of entries is defined by the order of calls addAscendingOrdering and addDescendingOrdering. This list contains instances of OrderingExpression as entries.

Specified by:
getOrderingExpressions in interface QueryTree
Returns:
the list of declared parameters

newIdentifier

public IdentifierExpression newIdentifier(java.lang.String identifier)
Returns an instance of either ThisExpression or VariableAccessExpression or ParameterAccessExpression or FieldAccessExpression depending on the fact which of the classes the argument identifier maps to. This method throws NullPointerException if the argument identifier is null or the candidate class is not set. Note: If you pass "this" as an identifier name, then an instance of ThisExpression is returned. If you pass any other java key word as an identifier name, then an instance of JDOQueryException is thrown.

Specified by:
newIdentifier in interface ExpressionFactory
Parameters:
identifier - the name of the identifier access expression
Returns:
the specialized identifier access expression instance
Throws:
java.lang.NullPointerException - if identifier is null
JDOQueryException - if identifier is a java key word.

newFieldAccess

public FieldAccessExpression newFieldAccess(Expression target,
                                            java.lang.String fieldName)
Returns an instance of FieldAccessExpression. This method throws NullPointerException if one of the arguments target or fieldName are null.

Specified by:
newFieldAccess in interface ExpressionFactory
Parameters:
target - the target expression of the field access expression
fieldName - the name of the field to access
Returns:
the field access expression instance
Throws:
java.lang.NullPointerException - if target or fieldName are null

newFieldAccess

public StaticFieldAccessExpression newFieldAccess(java.lang.Class clazz,
                                                  java.lang.String fieldName)
Returns an instance of StaticFieldAccessExpression. This method throws NullPointerException if one of the arguments clazz or fieldName are null.

Specified by:
newFieldAccess in interface ExpressionFactory
Parameters:
clazz - the class instance defining the field
fieldName - the name of the field to access
Returns:
the static field access expression instance
Throws:
java.lang.NullPointerException - if clazz or fieldName are null

newMethodCall

public MethodCallExpression newMethodCall(Expression target,
                                          java.lang.String methodName,
                                          Expression[] arguments)
Returns an instance of MethodCallExpression. Note: If the method corresponding with methodName does not have any arguments, then the argument arguments is ignored. This method throws NullPointerException if one of the arguments target or methodName are null.

Specified by:
newMethodCall in interface ExpressionFactory
Parameters:
target - the target expression of the method call expression
methodName - the name of the method
arguments - the array of arguments
Returns:
the specialized method call expression
Throws:
java.lang.NullPointerException - if target or methodName are null
JDOQueryException - if methodName is not one of "contains", "endsWith", "isEmpty" or "startsWith".

newCast

public CastExpression newCast(java.lang.Class clazz,
                              Expression expression)
Returns an instance of CastExpression. This method throws NullPointerException if one of the arguments clazz or expression are null.

Specified by:
newCast in interface ExpressionFactory
Parameters:
clazz - the Java class to cast the argument expression to
expression - the expression to cast
Returns:
the cast expression instance
Throws:
java.lang.NullPointerException - if expression is null

newConstant

public ConstantExpression newConstant(java.lang.Object value)
Returns an instance of ConstantExpression. This method handles null as a constant expression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
value - the object wrapped by the constant expression
Returns:
the constant expression instance

newConstant

public ConstantExpression newConstant(boolean b)
Returns an instance of BooleanLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
b - the value wrapped by the boolean expression
Returns:
the boolean expression instance

newConstant

public ConstantExpression newConstant(byte b)
Returns an instance of ByteLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
b - the value wrapped by the byte expression
Returns:
the byte expression instance

newConstant

public ConstantExpression newConstant(char c)
Returns an instance of CharLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
c - the value wrapped by the char expression
Returns:
the char expression instance

newConstant

public ConstantExpression newConstant(double d)
Returns an instance of DoubleLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
d - the value wrapped by the double expression
Returns:
the double expression instance

newConstant

public ConstantExpression newConstant(float f)
Returns an instance of FloatLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
f - the value wrapped by the float expression
Returns:
the float expression instance

newConstant

public ConstantExpression newConstant(int i)
Returns an instance of IntLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
i - the value wrapped by the int expression
Returns:
the int expression instance

newConstant

public ConstantExpression newConstant(long l)
Returns an instance of LongLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
l - the value wrapped by the long expression
Returns:
the long expression instance

newConstant

public ConstantExpression newConstant(short s)
Returns an instance of ShortLiteralExpression.

Specified by:
newConstant in interface ExpressionFactory
Parameters:
s - the value wrapped by the short expression
Returns:
the short expression instance

newComplement

public ComplementExpression newComplement(Expression expr)
Returns a complement expression for the argument expr. This method throws NullPointerException if the argument expr is null.

Specified by:
newComplement in interface ExpressionFactory
Parameters:
expr - the expression argument for the operation
Returns:
the complement expression instance
Throws:
java.lang.NullPointerException - if expr is null

newMinus

public UnaryMinusExpression newMinus(Expression expr)
Returns a unary minus expression for the argument expr. This method throws NullPointerException if the argument expr is null.

Specified by:
newMinus in interface ExpressionFactory
Parameters:
expr - the expression argument for the operation
Returns:
the unary minus expression instance
Throws:
java.lang.NullPointerException - if expr is null

newNot

public NotExpression newNot(Expression expr)
Returns a not expression for the argument expr. This method throws NullPointerException if the argument expr is null.

Specified by:
newNot in interface ExpressionFactory
Parameters:
expr - the expression argument for the operation
Returns:
the not expression instance
Throws:
java.lang.NullPointerException - if expr is null

newPlus

public UnaryPlusExpression newPlus(Expression expr)
Returns a plus expression for the argument expr. This method throws NullPointerException if the argument expr is null.

Specified by:
newPlus in interface ExpressionFactory
Parameters:
expr - the expression argument for the operation
Returns:
the plus expression instance
Throws:
java.lang.NullPointerException - if expr is null

newAnd

public AndExpression newAnd(Expression left,
                            Expression right)
Returns an and expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newAnd in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the and expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newConditionalAnd

public ConditionalAndExpression newConditionalAnd(Expression left,
                                                  Expression right)
Returns a conditional and expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newConditionalAnd in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the conditional and expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newConditionalOr

public ConditionalOrExpression newConditionalOr(Expression left,
                                                Expression right)
Returns a conditional or expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newConditionalOr in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the conditional or expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newDivide

public DivideExpression newDivide(Expression left,
                                  Expression right)
Returns a divide expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newDivide in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the divide expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newEquals

public EqualsExpression newEquals(Expression left,
                                  Expression right)
Returns an equals expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newEquals in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the equals expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newGreaterThan

public GreaterThanExpression newGreaterThan(Expression left,
                                            Expression right)
Returns a greater than expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newGreaterThan in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the greater than expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newGreaterThanEquals

public GreaterThanEqualsExpression newGreaterThanEquals(Expression left,
                                                        Expression right)
Returns a greater than equals expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newGreaterThanEquals in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the greater than equals expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newLessThan

public LessThanExpression newLessThan(Expression left,
                                      Expression right)
Returns a less than expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newLessThan in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the less than expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newLessThanEquals

public LessThanEqualsExpression newLessThanEquals(Expression left,
                                                  Expression right)
Returns a less than equals expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newLessThanEquals in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the less than equals expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newMinus

public MinusExpression newMinus(Expression left,
                                Expression right)
Returns a minus expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newMinus in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the minus expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newNotEquals

public NotEqualsExpression newNotEquals(Expression left,
                                        Expression right)
Returns a not equals expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newNotEquals in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the not equals expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newPlus

public PlusExpression newPlus(Expression left,
                              Expression right)
Returns a plus expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newPlus in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the plus expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newOr

public OrExpression newOr(Expression left,
                          Expression right)
Returns an or expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newOr in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the or expression instance
Throws:
java.lang.NullPointerException - if left or right are null

newTimes

public TimesExpression newTimes(Expression left,
                                Expression right)
Returns a times expression for the arguments left and right. This method throws NullPointerException if one of the arguments left or right are null.

Specified by:
newTimes in interface ExpressionFactory
Parameters:
left - the left expression argument for the operation
right - the right expression argument for the operation
Returns:
the times expression instance
Throws:
java.lang.NullPointerException - if left or right are null

getChildren

public Node[] getChildren()
Returns the children of this node. This method ensures that the children array corresponds with the children nodes of the underlying ANTLR tree structure.

Specified by:
getChildren in interface Node
Overrides:
getChildren in class NodeImpl
Returns:
the children
Throws:
JDOQueryException - if the candidate class is not set

arrive

public void arrive(NodeVisitor visitor)
Delegates to the argument visitor.

Specified by:
arrive in interface Node
Overrides:
arrive in class NodeImpl
Parameters:
visitor - the node visitor

leave

public java.lang.Object leave(NodeVisitor visitor,
                              java.lang.Object[] results)
Delegates to the argument visitor.

Specified by:
leave in interface Node
Overrides:
leave in class NodeImpl
Parameters:
visitor - the node visitor
results - the result array
Returns:
the object returned by the visitor instance

walkNextChild

public boolean walkNextChild(NodeVisitor visitor,
                             java.lang.Object resultOfPreviousChild,
                             int indexOfNextChild)
Delegates to the argument visitor.

Specified by:
walkNextChild in interface Node
Overrides:
walkNextChild in class NodeImpl
Parameters:
visitor - the node visitor
resultOfPreviousChild - the result computed by leaving the previous child node.
indexOfNextChild - the index of the next child node
Returns:
the boolean value returned by the visitor instance

initANTLRAST

public void initANTLRAST()
Ensures that this node has a corresponding ANTLR tree structure.

Throws:
JDOQueryException - if the candidate class is not set

getSerializedCandidateClassName

public java.lang.String getSerializedCandidateClassName()
Returns the candidate class name calculated during serialization of this query tree instance.

Returns:
serialized candidate class name


Copyright © 2005-2008 Apache Software Foundation. All Rights Reserved.