org.apache.tapestry.contrib.tree.model
Interface ITreeDataModel

All Known Implementing Classes:
SimpleTreeDataModel

public interface ITreeDataModel

The interface that defines a suitable data model for a TreeView component.

Version:
$Id: ITreeDataModel.java 243791 2004-02-19 17:38:13Z hlship $
Author:
ceco

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 objChildUniqueKey, Object objParentUniqueKey)
          Check to see (on the basis of some node object identifier) whether the parent node is indeed the parent of the object
 

Method Detail

getRoot

Object getRoot()
Returns the root node of the tree


getChildCount

int getChildCount(Object objParent)
Returns the number of children of parent node.

Parameters:
objParent - is the parent object whose nr of children are sought

getChildren

Iterator getChildren(Object objParent)
Get an iterator to the Collection of children belonging to the parent node object

Parameters:
objParent - is the parent object whose children are requested

getObject

Object getObject(Object objUniqueKey)
Get the actual node object based on some identifier (for example an UUID)

Parameters:
objUniqueKey - is the unique identifier of the node object being retrieved
Returns:
the instance of the node object identified by the key

getUniqueKey

Object getUniqueKey(Object objTarget,
                    Object objParentUniqueKey)
Get the unique identifier (UUID) of the node object with a certain parent node

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

getParentUniqueKey

Object getParentUniqueKey(Object objChildUniqueKey)
Get the unique identifier of the parent of an object

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

isAncestorOf

boolean isAncestorOf(Object objChildUniqueKey,
                     Object objParentUniqueKey)
Check to see (on the basis of some node object identifier) whether the parent node is indeed the parent of the object

Parameters:
objChildUniqueKey - is the identifier of the object whose parent is being checked
objParentUniqueKey - is the identifier of the parent which is to be checked against