org.apache.tapestry.contrib.tree.simple
Class SimpleTreeDataModel

java.lang.Object
  extended by org.apache.tapestry.contrib.tree.simple.SimpleTreeDataModel
All Implemented Interfaces:
Serializable, ITreeDataModel

public class SimpleTreeDataModel
extends Object
implements ITreeDataModel, Serializable

Version:
$Id: SimpleTreeDataModel.java 243828 2004-03-09 12:54:18Z tsvetelin $
Author:
ceco
See Also:
Serialized Form

Field Summary
protected  ITreeNode m_objRootNode
           
 
Constructor Summary
SimpleTreeDataModel(ITreeNode objRootNode)
          Constructor for SimpleTreeDataModel.
 
Method Summary
 int getChildCount(Object objParent)
          Returns the number of children of parent node.
 Iterator getChildren(Object objParent)
          Get an iterator to the Collection of children belonging to the parent node object
 Object getObject(Object objUniqueKey)
          Get the actual node object based on some identifier (for example an UUID)
 Object getParentUniqueKey(Object objChildUniqueKey)
          Get the unique identifier of the parent of an object
 Object getRoot()
          Returns the root node of the tree
 Object getUniqueKey(Object objTarget, Object objParentUniqueKey)
          Get the unique identifier (UUID) of the node object with a certain parent node
 boolean isAncestorOf(Object objTargetUniqueKey, Object objParentUniqueKey)
          Check to see (on the basis of some node object identifier) whether the parent node is indeed the parent of the object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_objRootNode

protected ITreeNode m_objRootNode
Constructor Detail

SimpleTreeDataModel

public SimpleTreeDataModel(ITreeNode objRootNode)
Constructor for SimpleTreeDataModel.

Method Detail

getRoot

public Object getRoot()
Description copied from interface: ITreeDataModel
Returns the root node of the tree

Specified by:
getRoot in interface ITreeDataModel
See Also:
ITreeDataModel.getRoot()

getChildCount

public int getChildCount(Object objParent)
Description copied from interface: ITreeDataModel
Returns the number of children of parent node.

Specified by:
getChildCount in interface ITreeDataModel
Parameters:
objParent - is the parent object whose nr of children are sought
See Also:
ITreeDataModel.getChildCount(Object)

getChildren

public Iterator getChildren(Object objParent)
Description copied from interface: ITreeDataModel
Get an iterator to the Collection of children belonging to the parent node object

Specified by:
getChildren in interface ITreeDataModel
Parameters:
objParent - is the parent object whose children are requested
See Also:
ITreeDataModel.getChildren(Object)

getObject

public Object getObject(Object objUniqueKey)
Description copied from interface: ITreeDataModel
Get the actual node object based on some identifier (for example an UUID)

Specified by:
getObject in interface ITreeDataModel
Parameters:
objUniqueKey - is the unique identifier of the node object being retrieved
Returns:
the instance of the node object identified by the key
See Also:
ITreeDataModel.getObject(Object)

getUniqueKey

public Object getUniqueKey(Object objTarget,
                           Object objParentUniqueKey)
Description copied from interface: ITreeDataModel
Get the unique identifier (UUID) of the node object with a certain parent node

Specified by:
getUniqueKey in interface ITreeDataModel
Parameters:
objTarget - is the Object whose identifier is required
objParentUniqueKey - is the unique id of the parent of objTarget
Returns:
the unique identifier of objTarget
See Also:
ITreeDataModel.getUniqueKey(Object, Object)

isAncestorOf

public boolean isAncestorOf(Object objTargetUniqueKey,
                            Object objParentUniqueKey)
Description copied from interface: ITreeDataModel
Check to see (on the basis of some node object identifier) whether the parent node is indeed the parent of the object

Specified by:
isAncestorOf in interface ITreeDataModel
Parameters:
objTargetUniqueKey - is the identifier of the object whose parent is being checked
objParentUniqueKey - is the identifier of the parent which is to be checked against
See Also:
ITreeDataModel.isAncestorOf(Object, Object)

getParentUniqueKey

public Object getParentUniqueKey(Object objChildUniqueKey)
Description copied from interface: ITreeDataModel
Get the unique identifier of the parent of an object

Specified by:
getParentUniqueKey in interface ITreeDataModel
Parameters:
objChildUniqueKey - is the identifier of the Object for which the parent identifier is sought
Returns:
the identifier (possibly UUID) of the parent of objChildUniqueKey
See Also:
ITreeDataModel.getParentUniqueKey(java.lang.Object)