N
- the kind of elements in the treepublic interface Tree<N>
Modifier and Type | Method and Description |
---|---|
void |
dump(java.io.PrintWriter writer) |
void |
dump(java.io.PrintWriter writer,
int indent) |
java.util.List<N> |
fillDepthFirst() |
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.
|
java.lang.Object |
getEdge(Tree<N> child) |
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 |
setNodeRenderer(NodeRenderer<N> renderer) |
void |
sortChildren(java.util.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.java.util.List<Tree<N>> getChildren()
java.lang.Object getEdge(Tree<N> child)
child
- the child to usevoid 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<N> getUserObjectPathToRoot()
void dump(java.io.PrintWriter writer)
writer
- the writer to print tovoid dump(java.io.PrintWriter writer, int indent)
writer
- the writer to print toindent
- how much to indentvoid setNodeRenderer(NodeRenderer<N> renderer)
renderer
- the renderer to usejava.util.Set<N> getUserObjectClosure()
java.util.List<N> fillDepthFirst()