public class Tree extends Object
Modifier and Type | Field and Description |
---|---|
static String |
POSTORDER
The postorder constant.
|
static String |
PREORDER
The preorder constant.
|
Constructor and Description |
---|
Tree()
Create a new tree.
|
Tree(TreeNode root)
Create a new tree.
|
Modifier and Type | Method and Description |
---|---|
TreeNode |
getRootNode()
Return the root node of the tree.
|
boolean |
isEmpty()
Test if empty.
|
void |
setRootElement(TreeNode root)
Set the root node for the tree.
|
List |
toList(String order)
Returns the tree as a List of node objects.
|
String |
toString()
Returns a String representation of the tree.
|
public static final String PREORDER
public static final String POSTORDER
public Tree()
public Tree(TreeNode root)
public TreeNode getRootNode()
public void setRootElement(TreeNode root)
root
- The root node to set.public List toList(String order)
public boolean isEmpty()
Copyright © 2013. All Rights Reserved.