Constructor and Description |
---|
CodedTree.Node(int index)
Constructs a node with the given index.
|
CodedTree.Node(int index,
CodedTree.Node... children)
Constructs a node with the given index and child nodes.
|
CodedTree.Node(int index,
List<CodedTree.Node> children)
Constructs a node with the given index and child nodes.
|
Modifier and Type | Method and Description |
---|---|
void |
addChildren(CodedTree.Node... nodes)
Adds the specified nodes as children of this node.
|
void |
addChildren(int... indices)
Creates leaf nodes with the specified indices and attaches them
as child nodes to this node.
|
boolean |
equals(Object o) |
List<CodedTree.Node> |
getChildren()
Returns the list of child nodes for this node.
|
int |
getIndex()
Returns the "index" value for this node.
|
CodedTree.Node |
getParent()
Returns the parent node for this node.
|
int |
hashCode() |
String |
toString() |
public CodedTree.Node(int index)
index
- the node indexpublic CodedTree.Node(int index, CodedTree.Node... children)
index
- the node indexchildren
- the child nodes to be attached to this nodepublic CodedTree.Node(int index, List<CodedTree.Node> children)
index
- the node indexchildren
- the child nodes to be attached to this nodepublic int getIndex()
public CodedTree.Node getParent()
public void addChildren(CodedTree.Node... nodes)
nodes
- the child nodespublic void addChildren(int... indices)
indices
- the indices of the child nodespublic List<CodedTree.Node> getChildren()
Copyright © 2015. All Rights Reserved.