All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class Tree.LabeledTreeNode

java.lang.Object
   |
   +----Tree.DefaultMutableTreeNode
           |
           +----Tree.LabeledTreeNode

public class LabeledTreeNode
extends DefaultMutableTreeNode
This class provides an updatable tree node which contains an extra field for a user-defined label. This label can then be used as the string which is displayed in visual tree components.


Variable Index

 o userLabel

Constructor Index

 o LabeledTreeNode(Object, String)
 o LabeledTreeNode(String)

Method Index

 o compareTo(LabeledTreeNode)
Compares the label of this node to the node passed as an argument and returns a number less than 0, equal to 0, or greater than 0 if lexiographically this node is before, equivalent to, or after the argument, respectively.
 o getLabel()
 o insertInSortedOrder(LabeledTreeNode)
Adds a new child to the node, placing it such that the children are sorted by the label.
 o setLabel(String)

Variables

 o userLabel
 protected String userLabel

Constructors

 o LabeledTreeNode
 public LabeledTreeNode(String userLabel)
 o LabeledTreeNode
 public LabeledTreeNode(Object userObject,
                        String userLabel)

Methods

 o setLabel
 public void setLabel(String userLabel)
 o getLabel
 public String getLabel()
 o insertInSortedOrder
 public void insertInSortedOrder(LabeledTreeNode newChild)
Adds a new child to the node, placing it such that the children are sorted by the label. Note, all children must be added using this routine for the entire set of children to be sored.

 o compareTo
 public int compareTo(LabeledTreeNode anotherNode)
Compares the label of this node to the node passed as an argument and returns a number less than 0, equal to 0, or greater than 0 if lexiographically this node is before, equivalent to, or after the argument, respectively.


All Packages  Class Hierarchy  This Package  Previous  Next  Index