|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectbeowulf.model.tree.AbstractBinaryTreeModel
beowulf.model.tree.DefaultBinaryTree
| Field Summary | |
protected int |
count
|
protected int |
maxDepth
|
protected boolean |
recalcMaxDepth
|
protected BinaryTreeNode |
root
|
| Fields inherited from class beowulf.model.tree.AbstractBinaryTreeModel |
listenerList |
| Constructor Summary | |
DefaultBinaryTree()
|
|
| Method Summary | |
void |
add(Object value)
This method will create a new node with the given value, and add it to the tree. |
Enumeration |
elements()
This will return an enumeration of all values in the tree. |
Object |
getChild(Object parent,
int index)
|
int |
getChildCount(Object parent)
|
int |
getIndexOfChild(Object parent,
Object child)
|
int |
getMaxDepth()
Returns the maximum depth of the tree. |
int |
getNodeCount()
Returns the number of nodes in the tree. |
BinaryTreeNode[] |
getPathToNode(BinaryTreeNode node)
|
Object |
getRoot()
|
boolean |
isLeaf(Object node)
|
protected void |
recalcMaxDepth(BinaryTreeNode root,
int depth)
|
void |
remove(Object value)
Given a node's value, this method will find and remove that node from the tree. |
String |
toString(boolean verbose)
Returns a verbose description if passed in true. |
void |
valueForPathChanged(TreePath path,
Object newValue)
|
| Methods inherited from class beowulf.model.tree.AbstractBinaryTreeModel |
addTreeModelListener, fireNodesChanged, fireNodesInserted, fireNodesRemoved, fireStructureChanged, getListeners, getTreeListeners, removeTreeModelListener |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected BinaryTreeNode root
protected int count
protected int maxDepth
protected boolean recalcMaxDepth
| Constructor Detail |
public DefaultBinaryTree()
| Method Detail |
public void add(Object value)
AbstractBinaryTreeModel
add in class AbstractBinaryTreeModelvalue - The value of the new node.public void remove(Object value)
AbstractBinaryTreeModel
remove in class AbstractBinaryTreeModelvalue - The value of the node to be removed.public BinaryTreeNode[] getPathToNode(BinaryTreeNode node)
public Enumeration elements()
BinaryTreeModel
public void valueForPathChanged(TreePath path,
Object newValue)
public Object getChild(Object parent,
int index)
public int getChildCount(Object parent)
public int getIndexOfChild(Object parent,
Object child)
public Object getRoot()
public boolean isLeaf(Object node)
public int getNodeCount()
BinaryTreeModel
public int getMaxDepth()
BinaryTreeModel
protected void recalcMaxDepth(BinaryTreeNode root,
int depth)
public String toString(boolean verbose)
BinaryTreeModel
verbose - Whether or not to return a verbose description.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||