|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.melati.util.ChildrenDrivenMutableTree
public class ChildrenDrivenMutableTree
A tree of DefaultMutableTreeNode
s,
the userObject
s of which
are Treeable
objects which supply their own
getChildren()
functions.
This is used to build the tree of
DefaultMutableTreeNode
s.
It also allows you to search the subtree for a particular
Treeable
object and returns the corresponding
DefaultMutableTreeNode
object if one exists.
DefaultMutableTreeNode
Field Summary | |
---|---|
static Enumeration |
EMPTY_ENUMERATION
An enumeration that is always empty. |
protected DefaultMutableTreeNode |
root
root node |
Constructor Summary | |
---|---|
ChildrenDrivenMutableTree()
Constructor. |
|
ChildrenDrivenMutableTree(Treeable userObject)
Constructor. |
Method Summary | |
---|---|
Enumeration |
breadthFirstEnumeration()
|
void |
buildTree()
Compute the children. |
void |
buildTree(Enumeration<DefaultMutableTreeNode> nodes)
Compute the children given the nodes. |
Enumeration |
depthFirstEnumeration()
|
DefaultMutableTreeNode |
getRoot()
|
DefaultMutableTreeNode |
getTreeNodeFor(Treeable search)
Find a node in a tree. |
Enumeration |
postorderEnumeration()
Return an enumeration of nodes in postorder, whatever that means. |
Enumeration |
preorderEnumeration()
Return an enumeration of nodes in preorder, whatever that means. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Enumeration EMPTY_ENUMERATION
protected DefaultMutableTreeNode root
Constructor Detail |
---|
public ChildrenDrivenMutableTree()
public ChildrenDrivenMutableTree(Treeable userObject)
userObject
- the rootMethod Detail |
---|
public void buildTree()
public void buildTree(Enumeration<DefaultMutableTreeNode> nodes)
nodes
- an Enumeration of nodespublic DefaultMutableTreeNode getTreeNodeFor(Treeable search)
search
- the node object
public DefaultMutableTreeNode getRoot()
public Enumeration preorderEnumeration()
Root is first node. What is the difference from breadth first?
public Enumeration postorderEnumeration()
Leftmost leaf is first. What is the difference from depth first?
public Enumeration breadthFirstEnumeration()
public Enumeration depthFirstEnumeration()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |