|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.jdo.jdoql.tree.AbstractNodeVisitor
org.apache.jdo.impl.jdoql.MemoryQuery
An instance of this class is used to evaluate a
query tree in memory. For this purpose this class keeps references
to a parameter/variable table and to the current object corresponding
with a ThisExpression
.
It extends AbstractNodeVisitor
.
To evaluate a query tree, you need to pass the query tree instance and
an instance of this class to method walk
of a tree walker
instance.
Constructor Summary | |
MemoryQuery(ParameterTable parameters,
VariableTable variables)
Constructs an instance of this class for the specified paramter table and variable table. |
|
MemoryQuery(PersistenceManagerInternal pm,
ParameterTable parameters,
VariableTable variables)
Constructs an instance of this class for the specified paramter table and variable table. |
Method Summary | |
java.lang.Object |
leave(AndExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(CastExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ComplementExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ConditionalAndExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ConditionalOrExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ConstantExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ContainsCallExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(DivideExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(EndsWithCallExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(EqualsExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(FieldAccessExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(GreaterThanEqualsExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(GreaterThanExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(IsEmptyCallExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(LessThanEqualsExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(LessThanExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(MinusExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(NotEqualsExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(NotExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(OrderingExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(OrExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ParameterAccessExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(PlusExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(StartsWithCallExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(StaticFieldAccessExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(ThisExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(TimesExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(UnaryMinusExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(UnaryPlusExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
java.lang.Object |
leave(VariableAccessExpression node,
java.lang.Object[] results)
Returns the result evaluated for the argument node . |
void |
setCurrent(java.lang.Object current)
Sets the instance returned by leaving an instance if ThisExpression . |
boolean |
walkNextChild(AndExpression node,
java.lang.Object resultOfPreviousChild,
int indexOfNextChild)
Returns false if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild is greater
than 0. |
boolean |
walkNextChild(ConditionalAndExpression node,
java.lang.Object resultOfPreviousChild,
int indexOfNextChild)
Returns false if the argument resultOfPreviousChild
is null , undefined or false and the argument indexOfNextChild is greater
than 0. |
boolean |
walkNextChild(ConditionalOrExpression node,
java.lang.Object resultOfPreviousChild,
int indexOfNextChild)
Returns false if the argument resultOfPreviousChild
is null , undefined or true and the argument indexOfNextChild is greater
than 0. |
boolean |
walkNextChild(ContainsCallExpression node,
java.lang.Object resultOfPreviousChild,
int indexOfNextChild)
Returns false if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild is greater
than 0. |
boolean |
walkNextChild(OrExpression node,
java.lang.Object resultOfPreviousChild,
int indexOfNextChild)
Returns false if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild is greater
than 0. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MemoryQuery(ParameterTable parameters, VariableTable variables)
parameters
- the parameter tablevariables
- the variable tablepublic MemoryQuery(PersistenceManagerInternal pm, ParameterTable parameters, VariableTable variables)
pm
- the persistence managerparameters
- the parameter tablevariables
- the variable tableMethod Detail |
public void setCurrent(java.lang.Object current)
ThisExpression
.
current
- the instance to setpublic java.lang.Object leave(AndExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non boolean typespublic java.lang.Object leave(CastExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is the same as the result evaluated by the child
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by the node's child
JDOQueryException
- if the result evaluated by the node's
child is not an instance of the type to cast topublic java.lang.Object leave(ComplementExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is based on the result evaluated by the child
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by the node's child
JDOQueryException
- if the result evaluated by the node's
child is not a boolean or integral type.public java.lang.Object leave(ConditionalAndExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non boolean typespublic java.lang.Object leave(ConditionalOrExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non boolean typespublic java.lang.Object leave(ConstantExpression node, java.lang.Object[] results)
node
.
The argument results
is null
as the argument
node
does not have any children. The result
returned by this method is the object wrapped by the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- null
public java.lang.Object leave(ContainsCallExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(DivideExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(EndsWithCallExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(EqualsExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(FieldAccessExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children is undefinedpublic java.lang.Object leave(GreaterThanEqualsExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(GreaterThanExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(IsEmptyCallExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(LessThanEqualsExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(LessThanExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(MinusExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(NotEqualsExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(NotExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is based on the result evaluated by the child
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by child of node
public java.lang.Object leave(OrderingExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is based on the result evaluated by the child
of the argument node
.
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by child of node
public java.lang.Object leave(OrExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non boolean typespublic java.lang.Object leave(ParameterAccessExpression node, java.lang.Object[] results)
node
.
The argument results
is null
as the argument
node
does not have any children. The result
returned by this method is the instance obtained by the parameter table
for for the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- null
public java.lang.Object leave(PlusExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(StartsWithCallExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(StaticFieldAccessExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
public java.lang.Object leave(ThisExpression node, java.lang.Object[] results)
node
.
The argument results
is null
as the argument
node
does not have any children. The result
returned by this method is the current instance stored in this node visitor
by method setCurrent
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- null
setCurrent
public java.lang.Object leave(TimesExpression node, java.lang.Object[] results)
node
.
The argument results
contains the results evaluated
by the children of the argument node
. The result
returned by this method is based on the results evaluated by the children
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the results evaluated by children of node
JDOQueryException
- if the results evaluated by the node's
children are non integral typespublic java.lang.Object leave(UnaryMinusExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is based on the result evaluated by the child
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by the node's child
JDOQueryException
- if the result evaluated by the node's
child is not an integral type.public java.lang.Object leave(UnaryPlusExpression node, java.lang.Object[] results)
node
.
The argument results
contains the result evaluated
by the child of the argument node
. The result
returned by this method is the same as the result evaluated by the child
of the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- the result evaluated by the node's child
public java.lang.Object leave(VariableAccessExpression node, java.lang.Object[] results)
node
.
The argument results
is null
as the argument
node
does not have any children. The result
returned by this method is the instance obtained by the variable table
for for the argument node
.
leave
in interface NodeVisitor
leave
in class AbstractNodeVisitor
node
- the node to be evaluatedresults
- null
public boolean walkNextChild(AndExpression node, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater
than 0.
walkNextChild
in interface NodeVisitor
walkNextChild
in class AbstractNodeVisitor
node
- the parent node of the children currently evaluatedresultOfPreviousChild
- an array of null
instancesindexOfNextChild
- the index of the next child to be dumped
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater
than 0public boolean walkNextChild(ConditionalAndExpression node, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
false
if the argument resultOfPreviousChild
is null
, undefined or false
and the argument indexOfNextChild
is greater
than 0.
walkNextChild
in interface NodeVisitor
walkNextChild
in class AbstractNodeVisitor
node
- the parent node of the children currently evaluatedresultOfPreviousChild
- an array of null
instancesindexOfNextChild
- the index of the next child to be dumped
false
if the argument resultOfPreviousChild
is null
, undefined or false
and the argument indexOfNextChild
is greater
than 0public boolean walkNextChild(ConditionalOrExpression node, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
false
if the argument resultOfPreviousChild
is null
, undefined or true
and the argument indexOfNextChild
is greater
than 0.
walkNextChild
in interface NodeVisitor
walkNextChild
in class AbstractNodeVisitor
node
- the parent node of the children currently evaluatedresultOfPreviousChild
- an array of null
instancesindexOfNextChild
- the index of the next child to be dumped
false
if the argument resultOfPreviousChild
is null
, undefined or true
and the argument indexOfNextChild
is greater
than 0public boolean walkNextChild(ContainsCallExpression node, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater
than 0.
walkNextChild
in interface NodeVisitor
walkNextChild
in class AbstractNodeVisitor
node
- the parent node of the children currently evaluatedresultOfPreviousChild
- an array of null
instancesindexOfNextChild
- the index of the next child to be dumped
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater than 0public boolean walkNextChild(OrExpression node, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater
than 0.
walkNextChild
in interface NodeVisitor
walkNextChild
in class AbstractNodeVisitor
node
- the parent node of the children currently evaluatedresultOfPreviousChild
- an array of null
instancesindexOfNextChild
- the index of the next child to be dumped
false
if the argument resultOfPreviousChild
is undefined and the argument indexOfNextChild
is greater
than 0
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |