|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.aethersanctum.curlyml.Node
public class Node
The basic building block of a loaded CurlyML tree.
All nodes are named, and may have a list of child nodes attached. There is a semantic difference between a parent node with no children, and a leaf node.
Constructor Summary | |
---|---|
Node(java.lang.String nodeText)
Create a new Node. |
Method Summary | |
---|---|
void |
addChild(Node child)
add a child to this node's child list. |
java.util.List<Node> |
getChildren()
Get me all the children this node has. |
java.lang.String |
getText()
get this node's name/text value |
boolean |
hasChildren()
check to see if a node has chilren. |
boolean |
isParent()
a Node is a parent if it has a child list attached (may be empty) |
void |
markAsParent()
Mark this node as a parent. |
void |
setChildren(java.util.List<Node> children)
Replace/set this node's child list. |
void |
setText(java.lang.String text)
set this node's name/text value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Node(java.lang.String nodeText)
nodeText
- markAsParent()
Method Detail |
---|
public java.util.List<Node> getChildren()
public void setChildren(java.util.List<Node> children)
children
- public void markAsParent()
public java.lang.String getText()
public void setText(java.lang.String text)
text
- public boolean isParent()
public boolean hasChildren()
public void addChild(Node child)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |