Class Node
- java.lang.Object
-
- org.datanucleus.store.query.compiler.Node
-
- Direct Known Subclasses:
ParameterNode
public class Node extends 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
Fields Modifier and Type Field Description protected List<Node>childNodesList of child nodes in the tree below here.protected NodeTypenodeTypeType of node.protected ObjectnodeValueValue of the node.protected NodeparentParent of this node.protected List<Node>propertiesList of properties for the node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddProperty(Node node)NodeappendChildNode(Node node)Nodeclone(Node parent)NodegetChildNode(int index)List<Node>getChildNodes()NodegetFirstChild()Access the first child node.NodegetNextChild()Access the next node.StringgetNodeChildId()StringgetNodeId()NodeTypegetNodeType()ObjectgetNodeValue()NodegetParent()List<Node>getProperties()booleanhasNextChild()Return whether there is a "next" child node.booleanhasProperties()NodeinsertChildNode(Node node)NodeinsertChildNode(Node node, int position)voidremoveChildNode(Node node)voidsetNodeValue(Object val)voidsetParent(Node parent)voidsetPropertyAtPosition(int position, Node node)StringtoString()Method to print out the Node as a tree.
-
-
-
Method Detail
-
getNodeType
public NodeType getNodeType()
-
setNodeValue
public void setNodeValue(Object val)
-
getNodeValue
public Object getNodeValue()
-
hasProperties
public boolean hasProperties()
-
addProperty
public void addProperty(Node node)
-
setPropertyAtPosition
public void setPropertyAtPosition(int position, Node node)
-
removeChildNode
public void removeChildNode(Node node)
-
getChildNode
public Node getChildNode(int index)
-
getFirstChild
public Node getFirstChild()
Access the first child node.- Returns:
- The first node, or null if no children present
-
getNextChild
public Node getNextChild()
Access the next node. This asssumes that the methodgetFirstChild
has been called before.- Returns:
- The next child
-
hasNextChild
public boolean hasNextChild()
Return whether there is a "next" child node. Assumes that the methodgetFirstChild
has been called before.- Returns:
- Whether there is a next child node.
-
setParent
public void setParent(Node parent)
-
getParent
public Node getParent()
-
getNodeId
public String getNodeId()
-
getNodeChildId
public String getNodeChildId()
-
toString
public String toString()
Method to print out the Node as a tree.
-
-