|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.exolab.castor.jdo.oql.ParseTreeNode
public final class ParseTreeNode
A Node in the Parse tree which is generated by the Parser
as the tree
representation of the OQL Query. Each node has a link back to the parent node
(null for the root node), and a vector of children. Each node contains the
Token
which represents that part of the tree.
Constructor Summary | |
---|---|
ParseTreeNode(ParseTreeNode parent,
Token token)
Creates a new Node with supplied parent and token. |
|
ParseTreeNode(Token token)
Creates a new root Node with supplied token. |
Method Summary | |
---|---|
void |
addChild(ParseTreeNode child)
Adds a new node as a child of this node. |
java.util.Iterator<ParseTreeNode> |
children()
Accessor method for an iteration of this nodes children. |
ParseTreeNode |
getChild(int index)
Accessor method for individual children of this node. |
int |
getChildCount()
Accessor method for the number of children of this node. |
ParseTreeNode |
getParent()
Accessor method for the parent of this node. |
Token |
getToken()
Accessor method for the token. |
boolean |
isLeaf()
Specifies whether this node is a leaf. |
boolean |
isRoot()
Specifies whether this node is the root of a tree. |
void |
setParent(ParseTreeNode parent)
Changes the parent of this node. |
java.lang.String |
toString()
|
java.lang.String |
toStringEx()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ParseTreeNode(ParseTreeNode parent, Token token)
parent
- The parent of this node (null for root)token
- The token data in this nodepublic ParseTreeNode(Token token)
token
- The token data in this nodeMethod Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringEx()
public void setParent(ParseTreeNode parent)
parent
- The new parent.public void addChild(ParseTreeNode child)
child
- The new childpublic boolean isRoot()
public boolean isLeaf()
public ParseTreeNode getParent()
public java.util.Iterator<ParseTreeNode> children()
public ParseTreeNode getChild(int index)
index
- the index of the child to retrieve.
public int getChildCount()
public Token getToken()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |