Package com.microstrategy.utils
Class Tree<T>
- java.lang.Object
-
- com.microstrategy.utils.Tree<T>
-
- Type Parameters:
T
-
public class Tree<T> extends java.lang.Object
The tree structure whose value on each tree node is of type T.
-
-
Constructor Summary
Constructors Constructor Description Tree()
Default constructor.Tree(GenericTreeNode<T> root, GenericTreeNode<T> current)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericTreeNode<T>
getCurrentNode()
Returns the current node of the tree.java.util.List<FlattenedTreeNode>
getFlattenedTree()
Returns a list ofFlattenedTreeNode
which represents the current tree.GenericTreeNode<T>
getRootNode()
Returns the root node.void
setCurrentNode(GenericTreeNode<T> currentNode)
Sets the current node of the tree.void
setRootNode(GenericTreeNode<T> rootNode)
Sets the root node of the tree.
-
-
-
Constructor Detail
-
Tree
public Tree()
Default constructor.
-
Tree
public Tree(GenericTreeNode<T> root, GenericTreeNode<T> current)
Constructor.- Parameters:
root
- The root node of the tree.current
- The current node of the tree.
-
-
Method Detail
-
getRootNode
public GenericTreeNode<T> getRootNode()
Returns the root node.- Returns:
- root node of the tree.
-
setRootNode
public void setRootNode(GenericTreeNode<T> rootNode)
Sets the root node of the tree.- Parameters:
rootNode
- the root node of the tree.
-
getCurrentNode
public GenericTreeNode<T> getCurrentNode()
Returns the current node of the tree.- Returns:
-
setCurrentNode
public void setCurrentNode(GenericTreeNode<T> currentNode)
Sets the current node of the tree.- Parameters:
currentNode
- current node.
-
getFlattenedTree
public java.util.List<FlattenedTreeNode> getFlattenedTree()
Returns a list ofFlattenedTreeNode
which represents the current tree.- Returns:
- A
List
ofFlattenedTreeNode
.
-
-