|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.greenhopper.service.hierarchy.Tree<T>
public class Tree<T>
A generic tree data structure. Nodes with a parent-child-relationship are used to link the tree data. Each node carries the actual data object as a payload. This way, the data can be kept unaware of the possibility of being tree-organised. TODO change to child-parent-link to evade recursion (see http://myarch.com/treeiter/traditways)
Constructor Summary | |
---|---|
Tree(T data)
|
|
Tree(TreeNode<T> rootNode)
|
Method Summary | |
---|---|
java.util.List<TreeNode<T>> |
getAllNodes()
Get a list of all tree nodes, starting with the root node. |
java.util.List<T> |
getDataFromAllChildren()
Get a list of data payload objects from all children of the root node |
java.util.List<T> |
getDataFromAllChildren(java.util.Comparator<T> comp)
|
java.util.List<T> |
getDataFromAllChildren(T parent)
Get a list of data payload objects from all children of the given parent (possible sub-tree). |
java.util.List<T> |
getDataFromAllChildren(T parent,
java.util.Comparator<T> comp)
Get a list of data payload objects from all children of the given parent (possible sub-tree). |
TreeNode<T> |
getRootNode()
|
boolean |
isChild(T potentialChild)
Check if the given data payload is assigned to a child node |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Tree(TreeNode<T> rootNode)
public Tree(T data)
Method Detail |
---|
public java.util.List<TreeNode<T>> getAllNodes()
public java.util.List<T> getDataFromAllChildren(T parent)
public java.util.List<T> getDataFromAllChildren(T parent, java.util.Comparator<T> comp)
public java.util.List<T> getDataFromAllChildren()
public java.util.List<T> getDataFromAllChildren(java.util.Comparator<T> comp)
public TreeNode<T> getRootNode()
public boolean isChild(T potentialChild)
potentialChild
- : The data object to search for
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |