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.
static int CLASS
          class node type (use in a "from" clause for a candidate).
static int CREATOR
          creator node type.
static int IDENTIFIER
          identifier node type
static int INVOKE
          invoke node type.
static int LITERAL
          literal node type
static int NAME
          type name node type.
protected  int nodeType
          Type of node.
protected  java.lang.Object nodeValue
          Value of the node.
static int OPERATOR
          operator node type.
static int PARAMETER
          parameter node type
protected  Node parent
          Parent of this node.
protected  java.util.List properties
          List of properties for the node.
protected  Symbol symbol
           
 
Constructor Summary
Node(int nodeType)
           
Node(int 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()
           
 int getNodeType()
           
 java.lang.Object getNodeValue()
           
 Node getParent()
           
 java.util.List getProperties()
           
 Symbol getSymbol()
           
 boolean hasNextChild()
           
 boolean hasProperties()
           
 Node insertChildNode(Node node)
           
 void setParent(Node parent)
           
 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

LITERAL

public static final int LITERAL
literal node type

See Also:
Constant Field Values

INVOKE

public static final int INVOKE
invoke node type. Such as method/function invocation.

See Also:
Constant Field Values

NAME

public static final int NAME
type name node type. Not defined what this was for so now being used for aliases in from clause.

See Also:
Constant Field Values

IDENTIFIER

public static final int IDENTIFIER
identifier node type

See Also:
Constant Field Values

OPERATOR

public static final int OPERATOR
operator node type.

See Also:
Constant Field Values

CREATOR

public static final int CREATOR
creator node type. Such as new X().

See Also:
Constant Field Values

CLASS

public static final int CLASS
class node type (use in a "from" clause for a candidate).

See Also:
Constant Field Values

PARAMETER

public static final int PARAMETER
parameter node type

See Also:
Constant Field Values

nodeType

protected int 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 properties
List of properties for the node. Used for invocation of methods, representing the arguments.

Constructor Detail

Node

public Node(int nodeType)

Node

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

getNodeType

public int getNodeType()

getNodeValue

public java.lang.Object getNodeValue()

hasProperties

public boolean hasProperties()

getProperties

public java.util.List getProperties()

addProperty

public void addProperty(Node node)

getChildNodes

public java.util.List getChildNodes()

insertChildNode

public Node insertChildNode(Node node)

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 © 2009. All Rights Reserved.