org.apache.jdo.jdoql.tree
Interface Node

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
AndExpression, AscendingOrderingExpression, BinaryExpression, BooleanLiteralExpression, ByteLiteralExpression, CandidateClass, CastExpression, CharLiteralExpression, ComplementExpression, ConditionalAndExpression, ConditionalOrExpression, ConstantExpression, ContainsCallExpression, Declaration, DescendingOrderingExpression, DivideExpression, DoubleLiteralExpression, EndsWithCallExpression, EqualsExpression, Expression, FieldAccessExpression, FloatLiteralExpression, GreaterThanEqualsExpression, GreaterThanExpression, IdentifierExpression, IntLiteralExpression, IsEmptyCallExpression, LessThanEqualsExpression, LessThanExpression, LongLiteralExpression, MethodCallExpression, MinusExpression, NotEqualsExpression, NotExpression, OrderingExpression, OrExpression, ParameterAccessExpression, ParameterDeclaration, PlusExpression, QueryTree, ShortLiteralExpression, StartsWithCallExpression, StaticFieldAccessExpression, ThisExpression, TimesExpression, Type, UnaryExpression, UnaryMinusExpression, UnaryPlusExpression, VariableAccessExpression, VariableDeclaration
All Known Implementing Classes:
AndExpr, AscendingOrderingExpr, BinaryExpr, BooleanLiteralExpr, ByteLiteralExpr, CandidateClassImpl, CastExpr, CharLiteralExpr, ComplementExpr, ConditionalAndExpr, ConditionalOrExpr, ConstantExpr, ContainsCallExpr, Decl, DescendingOrderingExpr, DivideExpr, DoubleLiteralExpr, EndsWithCallExpr, EqualsExpr, Expr, FieldAccessExpr, FloatLiteralExpr, GreaterThanEqualsExpr, GreaterThanExpr, IdentifierExpr, IntLiteralExpr, IsEmptyCallExpr, LessThanEqualsExpr, LessThanExpr, LongLiteralExpr, MethodCallExpr, MinusExpr, NodeImpl, NotEqualsExpr, NotExpr, OrderingExpr, OrExpr, ParameterAccessExpr, ParameterDecl, PlusExpr, ShortLiteralExpr, StartsWithCallExpr, StaticFieldAccessExpr, ThisExpr, TimesExpr, Tree, TypeImpl, UnaryExpr, UnaryMinusExpr, UnaryPlusExpr, VariableAccessExpr, VariableDecl

public interface Node
extends java.io.Serializable

This is the base interface of all nodes. Examples of nodes are , Declaration, Expression and OrderingExpression.

Author:
Michael Watzek

Method Summary
 void arrive(NodeVisitor visitor)
          This method is called by the tree walker when this node is walked but its children have not been walked yet.
 Node[] getChildren()
          Returns this node's children.
 java.lang.Class getJavaClass()
          Returns the Java type of this node.
 java.lang.Object getObject()
          Returns the user object.
 Node getParent()
          Returns this node's parent node.
 int getTokenType()
          Returns the token type of this node.
 java.lang.Object leave(NodeVisitor visitor, java.lang.Object[] results)
          This method is called by the tree walker when this node is walked and all of its children have been walked.
 void setObject(java.lang.Object object)
          Sets the user object.
 void setParent(Node parent)
          Sets the parent of this node.
 boolean walkNextChild(NodeVisitor visitor, java.lang.Object resultOfPreviousChild, int indexOfNextChild)
          This method is called by the tree walker after walking each child except the last child.
 

Method Detail

getObject

public java.lang.Object getObject()
Returns the user object.

Returns:
the ouser object

setObject

public void setObject(java.lang.Object object)
Sets the user object.

Parameters:
object - the user object

getParent

public Node getParent()
Returns this node's parent node.

Returns:
the parent node

setParent

public void setParent(Node parent)
Sets the parent of this node.

Parameters:
parent - the parent node

getChildren

public Node[] getChildren()
Returns this node's children.

Returns:
the children

getJavaClass

public java.lang.Class getJavaClass()
Returns the Java type of this node.

Returns:
the Java type

getTokenType

public int getTokenType()
Returns the token type of this node.

Returns:
the token type

arrive

public void arrive(NodeVisitor visitor)
This method is called by the tree walker when this node is walked but its children have not been walked yet. It delegates to the argument visitor.

Parameters:
visitor - the node visitor

leave

public java.lang.Object leave(NodeVisitor visitor,
                              java.lang.Object[] results)
This method is called by the tree walker when this node is walked and all of its children have been walked. It delegates to the argument visitor. The argument results contains the result instances returned by all leave methods of this node's children. This method returns the result instance of the delegation call of the argument visitor.

Parameters:
visitor - the node visitor
results - the result array containing result instances of this node's children
Returns:
the result instance of the delegation call of the argument visitor

walkNextChild

public boolean walkNextChild(NodeVisitor visitor,
                             java.lang.Object resultOfPreviousChild,
                             int indexOfNextChild)
This method is called by the tree walker after walking each child except the last child. It delegates to the argument visitor. The argument resultOfPreviousChild contains the result instance returned by the leave method of the last walked child. The argument indicates the index of the next child in the children array returned by method getChildren. If this method returns false then the tree walker does not walk any more children of this node. Instead, it calls method leave immediately.

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:
false if remaining children should not be walked


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