N
- the kind of elements in the treepublic interface Tree<N>
Modifier and Type | Method and Description |
---|---|
void |
dump(PrintWriter writer) |
void |
dump(PrintWriter writer,
int indent) |
List<N> |
fillDepthFirst() |
int |
getChildCount()
A convenience method that gets the number of child nodes that this node
has.
|
List<Tree<N>> |
getChildren()
Gets the children of this tree node.
|
Object |
getEdge(Tree<N> child) |
Tree<N> |
getParent()
Gets the parent of this tree node.
|
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.
|
Set<N> |
getUserObjectClosure() |
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 |
setNodeRenderer(NodeRenderer<N> renderer) |
void |
sortChildren(Comparator<Tree<N>> comparator)
Sorts the children using the specified comparator.
|
N getUserObject()
Tree<N> getParent()
null
if this node doesn't have a
parent.List<Tree<N>> getChildren()
Object getEdge(Tree<N> child)
child
- the child to usevoid sortChildren(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()
void dump(PrintWriter writer)
writer
- the writer to print tovoid dump(PrintWriter writer, int indent)
writer
- the writer to print toindent
- how much to indentvoid setNodeRenderer(NodeRenderer<N> renderer)
renderer
- the renderer to useCopyright © 2017 The University of Manchester. All Rights Reserved.