com.discoversites.util.collections.tree.array
Class ArrayTreeRoot<T>

java.lang.Object
  extended by com.discoversites.util.collections.tree.array.ArrayTreeNode<T>
      extended by com.discoversites.util.collections.tree.array.ArrayTreeRoot<T>
Type Parameters:
T - The type of element to be stored in the ArrayTreeRoot
All Implemented Interfaces:
TreeNode<T>, TreeRoot<T>, Serializable

public class ArrayTreeRoot<T>
extends ArrayTreeNode<T>
implements TreeRoot<T>

Implementation of TreeRoot backed by an ArrayList

Author:
Mark
See Also:
Serialized Form

Constructor Summary
protected ArrayTreeRoot(ArrayTree<T> parentTree)
           
 
Method Summary
 int getDepth()
           
 TreeNode<T> getParent()
           
 ArrayTree<T> getTree()
           
 boolean isRoot()
           
 
Methods inherited from class com.discoversites.util.collections.tree.array.ArrayTreeNode
addAll, addElement, addNode, addNode, getChildren, getElement, getRoot, getSiblings, isLeaf, removeNode, setElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.discoversites.util.collections.tree.TreeNode
addAll, addElement, addNode, addNode, getChildren, getElement, getRoot, getSiblings, isLeaf, removeNode, setElement
 

Constructor Detail

ArrayTreeRoot

protected ArrayTreeRoot(ArrayTree<T> parentTree)
Parameters:
parentTree - The parent ArrayTree object that this root node belongs to.
Method Detail

isRoot

public boolean isRoot()
Specified by:
isRoot in interface TreeNode<T>
Overrides:
isRoot in class ArrayTreeNode<T>
Returns:
True if this is a root node (i.e. it has no parents), false otherwise.

getTree

public ArrayTree<T> getTree()
Specified by:
getTree in interface TreeNode<T>
Overrides:
getTree in class ArrayTreeNode<T>
Returns:
The Tree that this node belongs to.

getParent

public TreeNode<T> getParent()
Specified by:
getParent in interface TreeNode<T>
Overrides:
getParent in class ArrayTreeNode<T>
Returns:
The parent node of this node.

getDepth

public int getDepth()
Specified by:
getDepth in interface TreeNode<T>
Overrides:
getDepth in class ArrayTreeNode<T>
Returns:
The depth (i.e. level) that this node occupies in it's parent Tree.