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

java.lang.Object
  extended byantlr.BaseAST
      extended byantlr.CommonAST
          extended byorg.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
              extended byorg.apache.jdo.impl.jdoql.tree.NodeImpl
                  extended byorg.apache.jdo.impl.jdoql.tree.Expr
                      extended byorg.apache.jdo.impl.jdoql.tree.MethodCallExpr
                          extended byorg.apache.jdo.impl.jdoql.tree.ContainsCallExpr
All Implemented Interfaces:
antlr.collections.AST, java.lang.Cloneable, ContainsCallExpression, Expression, MethodCallExpression, Node, java.io.Serializable

public final class ContainsCallExpr
extends MethodCallExpr
implements ContainsCallExpression

This node represents the method call expression Collection.contains. Children of this node are a target expression (e.g. a FieldAccessExpression) and the method argument which is an arbitrary expression.

Author:
Michael Watzek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.jdo.impl.jdoql.tree.MethodCallExpr
args
 
Fields inherited from class org.apache.jdo.impl.jdoql.tree.NodeImpl
children, clazz, msg, object, parent
 
Fields inherited from class org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
column, line, typeInfo
 
Fields inherited from class antlr.CommonAST
 
Fields inherited from class antlr.BaseAST
down, right
 
Constructor Summary
  ContainsCallExpr()
          The noarg constructor is needed for ANTLR support and deserialization.
(package private) ContainsCallExpr(Expression target, Expression arg)
          This constructor is called by the query tree instance.
(package private) ContainsCallExpr(Expression target, Expression[] args)
          This constructor is called by the query tree instance.
  ContainsCallExpr(antlr.Token token)
          The noarg constructor is needed for ANTLR support.
 
Method Summary
 void arrive(NodeVisitor visitor)
          Delegates to the argument visitor.
 java.lang.Object leave(NodeVisitor visitor, java.lang.Object[] results)
          Delegates to the argument visitor.
 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.MethodCallExpr
clone, getArguments, getMethodName, getTarget
 
Methods inherited from class org.apache.jdo.impl.jdoql.tree.NodeImpl
ASTToChildren, getChildren, getJavaClass, getObject, getParent, getTokenType, setChildren, 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.MethodCallExpression
getArguments, getMethodName, getTarget
 
Methods inherited from interface org.apache.jdo.jdoql.tree.Node
getChildren, getJavaClass, getObject, getParent, getTokenType, setObject, setParent
 

Constructor Detail

ContainsCallExpr

public ContainsCallExpr()
The noarg constructor is needed for ANTLR support and deserialization. The caller must make sure to set the ANTLR tree structure himself or, call setChildren optionally.


ContainsCallExpr

public ContainsCallExpr(antlr.Token token)
The noarg constructor is needed for ANTLR support. The caller must make sure to set the ANTLR tree structure himself or, call setChildren optionally.


ContainsCallExpr

ContainsCallExpr(Expression target,
                 Expression[] args)
This constructor is called by the query tree instance. It delegates to the super class constructor.

Parameters:
target - the target expression of this method call
args - the arguments of this method call
Throws:
JDOQueryException - if the result type of target is not a collection type or the length of args is not equal 1.

ContainsCallExpr

ContainsCallExpr(Expression target,
                 Expression arg)
This constructor is called by the query tree instance. It delegates to the super class constructor.

Parameters:
target - the target expression of this method call
arg - the argument of this method call
Method Detail

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 in the children array of the next child to walk
Returns:
the boolean value returned by the visitor instance