All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tea.set.Node

java.lang.Object
   |
   +----tea.set.Node

public class Node
extends Object
Node is used to implement the Forest widget. It contains code that does most of the actual work of tree related functions. This class is not intended to be used directly by user other than for the purpose of traversing the trees. This class is no longer a widget (component) for the purpose of resource optimization. It however implements a set of methods to partially simulate component behaviors.

Node supports the following properties:
Property NameProperty TypeDescription
ChildCountint Number of child nodes.
ChildNode (Readonly, Indexed) Get the n'th child of this node.
LabelString The label of this node.
PathString The full path of this node.


Method Index

 o equals(Object)
Two nodes are equal if they have same label and parents.
 o getChild(int)
Get the n'th child.
 o getChildCount()
Return the number of children.
 o getLabel()
Return node label.
 o getPath()
Return node path.
 o getUserData()
Get the user data of this node.
 o isLeaf()
True if this node has no child.
 o isOpen()
True if folder is open (subtree is expended).
 o setLeaf(boolean)
The Leaf property is determined by whether a node has any children.
 o setUserData(Object)
Set the user data of a node.
 o toString()
Convert to full path string.

Methods

 o setUserData
 public synchronized void setUserData(Object data)
Set the user data of a node. The user data is any object that will be carried by a node.

Parameters:
data - user data.
 o getUserData
 public Object getUserData()
Get the user data of this node.

Returns:
user data.
 o getChildCount
 public int getChildCount()
Return the number of children.

Returns:
number of children.
 o getChild
 public synchronized Node getChild(int child)
Get the n'th child.

Parameters:
child - child index.
Returns:
child node.
 o getLabel
 public String getLabel()
Return node label.

Returns:
node label.
 o getPath
 public synchronized String getPath()
Return node path. The path is the labels from root down to this node separated by the separator.

Returns:
node path.
 o toString
 public String toString()
Convert to full path string.

Returns:
node path.
Overrides:
toString in class Object
 o isOpen
 public synchronized boolean isOpen()
True if folder is open (subtree is expended).

Returns:
true if node is open.
 o isLeaf
 public boolean isLeaf()
True if this node has no child.

Returns:
true if this is a leaf node.
 o setLeaf
 public void setLeaf(boolean isleaf)
The Leaf property is determined by whether a node has any children. It can be overriden explicitly by setting the property through setLeaf().

Parameters:
isleaf - true if the node is always considered a leaf.
 o equals
 public boolean equals(Object o)
Two nodes are equal if they have same label and parents.

Parameters:
o - node.
Overrides:
equals in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index