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.
-
userLabel
-
-
LabeledTreeNode(Object, String)
-
-
LabeledTreeNode(String)
-
-
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.
-
getLabel()
-
-
insertInSortedOrder(LabeledTreeNode)
- Adds a new child to the node, placing it such that the children
are sorted by the label.
-
setLabel(String)
-
userLabel
protected String userLabel
LabeledTreeNode
public LabeledTreeNode(String userLabel)
LabeledTreeNode
public LabeledTreeNode(Object userObject,
String userLabel)
setLabel
public void setLabel(String userLabel)
getLabel
public String getLabel()
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.
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