- All Implemented Interfaces:
public class Tree<T,K>
- extends Object
- implements Serializable
Represents a Tree of Objects of generic type T. The Tree is represented as
a single rootElement which points to a List> of children. There is
no restriction on the number of children that a particular node may have.
This Tree provides a method to serialize the Tree into a List by doing a
pre-order traversal. It has several methods to allow easy updates of Nodes
in the Tree.
- See Also:
- Serialized Form
- Default constructor.
public Node<T,K> getRootElement()
- Return the root Node of the tree.
- the root element.
public void setRootElement(Node<T,K> rootElement)
- Set the root Element for the tree.
rootElement - the root element to set.
public List<Node<T,K>> toList()
- Returns the Tree as a List of Node objects. The elements of the
List are generated from a pre-order traversal of the tree.
- a List>.
public String toString()
- Returns a String representation of the Tree. The elements are generated
from a pre-order traversal of the Tree.
toString in class
- the String representation of the Tree.
Copyright © 2005-2012 The Kuali Foundation. All Rights Reserved.