org.objectweb.telosys.common.data
Class TreeNode

java.lang.Object
  extended byorg.objectweb.telosys.common.data.TreeNode
All Implemented Interfaces:
java.io.Serializable

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

Generic TreeNode to build objects trees

See Also:
Serialized Form

Constructor Summary
TreeNode(java.lang.Object object)
          Constructs a new TreeNode
TreeNode(java.lang.Object object, int type)
          Constructs a new TreeNode with a type
TreeNode(java.lang.Object object, java.lang.String id)
          Constructs a new TreeNode with an id
TreeNode(java.lang.Object object, java.lang.String id, int type)
          Constructs a new TreeNode with an id and a type
 
Method Summary
 boolean appendChild(TreeNode node)
          Appends a node at the end of the children of the node ( like W3C DOM )
 TreeNodeList getChildNodes()
          Returns all the children of the node ( like W3C DOM )
 java.lang.String getId()
          Returns the id of the node
 java.lang.Object getObject()
          Returns the object held by the node
 int getType()
          Returns the type of the node
 boolean hasChildNodes()
          Returns true if the node has children ( like W3C DOM )
 void setId(java.lang.String v)
          Set the id of the node
 void setObject(java.lang.Object v)
          Set the object held by the node
 void setType(int v)
          Set the type of the node
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TreeNode

public TreeNode(java.lang.Object object)
Constructs a new TreeNode

Parameters:
object -

TreeNode

public TreeNode(java.lang.Object object,
                int type)
Constructs a new TreeNode with a type

Parameters:
object -
type -

TreeNode

public TreeNode(java.lang.Object object,
                java.lang.String id)
Constructs a new TreeNode with an id

Parameters:
object -
id -

TreeNode

public TreeNode(java.lang.Object object,
                java.lang.String id,
                int type)
Constructs a new TreeNode with an id and a type

Parameters:
object -
id -
type -
Method Detail

setObject

public void setObject(java.lang.Object v)
Set the object held by the node

Parameters:
v -

getObject

public java.lang.Object getObject()
Returns the object held by the node

Returns:

setType

public void setType(int v)
Set the type of the node

Parameters:
v -

getType

public int getType()
Returns the type of the node

Returns:

setId

public void setId(java.lang.String v)
Set the id of the node

Parameters:
v -

getId

public java.lang.String getId()
Returns the id of the node

Returns:

getChildNodes

public TreeNodeList getChildNodes()
Returns all the children of the node ( like W3C DOM )

Returns:

hasChildNodes

public boolean hasChildNodes()
Returns true if the node has children ( like W3C DOM )

Returns:

appendChild

public boolean appendChild(TreeNode node)
Appends a node at the end of the children of the node ( like W3C DOM )

Parameters:
node -
Returns:

toString

public java.lang.String toString()