org.datanucleus.query.node
Class Node

java.lang.Object
  extended by org.datanucleus.query.node.Node
Direct Known Subclasses:
ParameterNode

public class Node
extends java.lang.Object

Representation of a node in a tree of nodes. Has a parent, and a list of children. Each node has a type and a value. Optionally has a set of properties; these represent arguments when part of a method call.


Field Summary
protected  java.util.List childNodes
          List of child nodes in the tree below here.
protected  NodeType nodeType
          Type of node.
protected  java.lang.Object nodeValue
          Value of the node.
protected  Node parent
          Parent of this node.
protected  java.util.List<Node> properties
          List of properties for the node.
protected  Symbol symbol
           
 
Constructor Summary
Node(NodeType nodeType)
           
Node(NodeType nodeType, java.lang.Object nodeValue)
           
 
Method Summary
 void addProperty(Node node)
           
 Node appendChildNode(Node node)
           
 Node[] appendChildNode(Node[] node)
           
 Node[][] appendChildNode(Node[][] node)
           
 Node getChildNode(int index)
           
 java.util.List getChildNodes()
           
 Node getFirstChild()
           
 Node getNextChild()
           
 java.lang.String getNodeChildId()
           
 java.lang.String getNodeId()
           
 NodeType getNodeType()
           
 java.lang.Object getNodeValue()
           
 Node getParent()
           
 java.util.List<Node> getProperties()
           
 Symbol getSymbol()
           
 boolean hasNextChild()
           
 boolean hasProperties()
           
 Node insertChildNode(Node node)
           
 Node insertChildNode(Node node, int position)
           
 void removeChildNode(Node node)
           
 void setNodeValue(java.lang.Object val)
           
 void setParent(Node parent)
           
 void setPropertyAtPosition(int position, Node node)
           
 void setSymbol(Symbol symbol)
           
 java.lang.String toString()
          Method to print out the Node as a tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nodeType

protected NodeType nodeType
Type of node.


nodeValue

protected java.lang.Object nodeValue
Value of the node.


symbol

protected Symbol symbol

parent

protected Node parent
Parent of this node.


childNodes

protected java.util.List childNodes
List of child nodes in the tree below here.


properties

protected java.util.List<Node> properties
List of properties for the node. Used for invocation of methods, representing the arguments.

Constructor Detail

Node

public Node(NodeType nodeType)

Node

public Node(NodeType nodeType,
            java.lang.Object nodeValue)
Method Detail

getNodeType

public NodeType getNodeType()

setNodeValue

public void setNodeValue(java.lang.Object val)

getNodeValue

public java.lang.Object getNodeValue()

hasProperties

public boolean hasProperties()

getProperties

public java.util.List<Node> getProperties()

addProperty

public void addProperty(Node node)

setPropertyAtPosition

public void setPropertyAtPosition(int position,
                                  Node node)

getChildNodes

public java.util.List getChildNodes()

removeChildNode

public void removeChildNode(Node node)

insertChildNode

public Node insertChildNode(Node node)

insertChildNode

public Node insertChildNode(Node node,
                            int position)

appendChildNode

public Node appendChildNode(Node node)

appendChildNode

public Node[] appendChildNode(Node[] node)

appendChildNode

public Node[][] appendChildNode(Node[][] node)

getChildNode

public Node getChildNode(int index)

getFirstChild

public Node getFirstChild()

getNextChild

public Node getNextChild()

hasNextChild

public boolean hasNextChild()

getSymbol

public Symbol getSymbol()

setSymbol

public void setSymbol(Symbol symbol)

setParent

public void setParent(Node parent)

getParent

public Node getParent()

getNodeId

public java.lang.String getNodeId()

getNodeChildId

public java.lang.String getNodeChildId()

toString

public java.lang.String toString()
Method to print out the Node as a tree.

Overrides:
toString in class java.lang.Object
Returns:
the node tree as a string


Copyright © 2011. All Rights Reserved.