com.mycompany.jsf.model
Class TreeNode

java.lang.Object
  extended bycom.mycompany.jsf.model.TreeNode
All Implemented Interfaces:
java.io.Serializable

public class TreeNode
extends java.lang.Object
implements java.io.Serializable

This class represents a node in a tree of nodes. Instances of this class are used as the nodes in the TreeModel.

Version:
1.0
Author:
Hans Bergsten, Gefion Software
See Also:
Serialized Form

Field Summary
private  java.util.List children
           
private  boolean isExpanded
           
private  boolean isLeafNode
           
private  java.lang.String name
           
private  TreeNode parent
           
private  java.lang.Object value
           
 
Constructor Summary
TreeNode()
           
 
Method Summary
 void addChild(TreeNode child)
          Adds the provided node as a child of this node.
 java.util.List getChildren()
          Returns all children of this node.
 java.lang.String getName()
          Returns the node name.
private  TreeNode getParent()
          Returns the parent of this node.
 java.lang.String getPath()
          Returns a String representing the path to this node, with the names of each parent node separated by a slash and ending with the name of the current node.
 java.lang.Object getValue()
          Returns the node value.
 boolean isExpanded()
          Returns "true" if the node is expanded,
 boolean isLeafNode()
          Returns "true" if this is a leaf node.
 void setExpanded(boolean isExpanded)
          Sets the "expanded" property value.
 void setLeafNode(boolean isLeafNode)
          Sets the "leafNode" property value.
 void setName(java.lang.String name)
          Sets the node name.
private  void setParent(TreeNode parent)
          Sets the parent of this node, called by the addChild() method.
 void setValue(java.lang.Object value)
          Sets the node value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private TreeNode parent

name

private java.lang.String name

value

private java.lang.Object value

isExpanded

private boolean isExpanded

isLeafNode

private boolean isLeafNode

children

private java.util.List children
Constructor Detail

TreeNode

public TreeNode()
Method Detail

getName

public java.lang.String getName()
Returns the node name.


setName

public void setName(java.lang.String name)
Sets the node name.


getValue

public java.lang.Object getValue()
Returns the node value.


setValue

public void setValue(java.lang.Object value)
Sets the node value.


isExpanded

public boolean isExpanded()
Returns "true" if the node is expanded,


setExpanded

public void setExpanded(boolean isExpanded)
Sets the "expanded" property value.


isLeafNode

public boolean isLeafNode()
Returns "true" if this is a leaf node.


setLeafNode

public void setLeafNode(boolean isLeafNode)
Sets the "leafNode" property value.


addChild

public void addChild(TreeNode child)
Adds the provided node as a child of this node.


getChildren

public java.util.List getChildren()
Returns all children of this node.


getPath

public java.lang.String getPath()
Returns a String representing the path to this node, with the names of each parent node separated by a slash and ending with the name of the current node.


getParent

private TreeNode getParent()
Returns the parent of this node.


setParent

private void setParent(TreeNode parent)
Sets the parent of this node, called by the addChild() method.