.
- 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. |
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 visitorresults
- 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 visitorresultOfPreviousChild
- the result computed by leaving the
previous child nodeindexOfNextChild
- the index in the children array of the
next child to walk
- Returns:
false
if remaining children should not be walked
Copyright © 2005 Apache Software Foundation. All Rights Reserved.