|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Tree<N>
Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 22-Jan-2008
Method Summary | |
---|---|
void |
dump(java.io.PrintWriter writer)
|
void |
dump(java.io.PrintWriter writer,
int indent)
|
int |
getChildCount()
A convenience method that gets the number of child nodes that this node has. |
java.util.List<Tree<N>> |
getChildren()
Gets the children of this tree node. |
Tree<N> |
getParent()
Gets the parent of this tree node. |
java.util.List<Tree<N>> |
getPathToRoot()
|
Tree<N> |
getRoot()
A convenience method that gets the root of this tree. |
N |
getUserObject()
Gets the "content" of this tree node. |
java.util.Set<N> |
getUserObjectClosure()
|
java.util.List<N> |
getUserObjectPathToRoot()
|
boolean |
isLeaf()
A convenience method that determines if this node is a leaf node (because it has no children). |
boolean |
isRoot()
A convenience method that determines if this is a root node (because it has no parent node) |
void |
sortChildren(java.util.Comparator<Tree<N>> comparator)
Sorts the children using the specified comparator |
Method Detail |
---|
N getUserObject()
Tree<N> getParent()
null
if this node doesn't have a parent.java.util.List<Tree<N>> getChildren()
void sortChildren(java.util.Comparator<Tree<N>> comparator)
comparator
- The comparator to be used for the sorting.int getChildCount()
boolean isRoot()
true
if this is a root node,
otherwise false
.boolean isLeaf()
true
if this node is a leaf
node otherwise false
.Tree<N> getRoot()
java.util.List<Tree<N>> getPathToRoot()
java.util.List<N> getUserObjectPathToRoot()
void dump(java.io.PrintWriter writer)
void dump(java.io.PrintWriter writer, int indent)
java.util.Set<N> getUserObjectClosure()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |