public class Tree extends Object implements Serializable
Constructor and Description |
---|
Tree()
Default ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear() |
Node |
find(Node element,
String nodeData)
Find a Node in a tree, containing the given data
|
Node |
find(String nodeData)
Find the Node in the tree containing the supplied data.
|
Node |
getRootElement()
Return the root Node of the tree.
|
boolean |
remove(String nodeData)
Removes the node with the supplied node data.
|
void |
setRootElement(Node rootElement)
Set the root Element for the tree.
|
List<Node> |
toList()
Returns the Tree as a List of Node objects.
|
String |
toString()
Returns a String representation of the Tree.
|
public Node getRootElement()
public void setRootElement(Node rootElement)
rootElement
- the root element to set.public List<Node> toList()
public String toString()
public Node find(String nodeData)
nodeData
- the node datapublic Node find(Node element, String nodeData)
element
- Node to start searching atnodeData
- to search forpublic void clear()
public boolean remove(String nodeData)
nodeData
- the node dataCopyright © 2013. All Rights Reserved.