com.ibm.mashups.enabler
Interface TreeModel

All Superinterfaces:
Locator, Model

public TreeModel
extends Model, Locator

This interface provides a generic tree model acting as a base class for all concrete tree models


Method Summary
 Deferred getRoot()
           Returns the root node of the model; may return null if the concrete tree model supports for empty models
 Boolean hasChildren(Object node)
           Returns whether or not the given node has children.
 DeferredIterator getChildren(Object node)
           Returns an iterator over the child elements for the given node.
 Deferred getParent(Object node)
           Returns the parent of a given node.
 
Methods inherited from interface com.ibm.mashups.enabler.model.Model
setStrategy, getStrategies, getStrategy, addStrategy, removeStrategy
 
Methods inherited from interface com.ibm.mashups.enabler.Locator
find
 

Method Detail

getRoot

Deferred getRoot()
Returns the root node of the model; may return null if the concrete tree model supports for empty models

Returns:
a deferred object used to start this operation. The return value when executed through the deferred object is the root object of the tree model

hasChildren

Boolean hasChildren(Object node)
Returns whether or not the given node has children. Please pay attention to the documentation of the return value; it is not guaranteed that children are present if the method returns true - the iterator might be empty.

Parameters:
node - node object or node uri (without any scope) for which to check if it has children. Must not be null.
Returns:
true if the specified node has children, false otherwise

getChildren

DeferredIterator getChildren(Object node)
Returns an iterator over the child elements for the given node.

Parameters:
node - node object or node uri (without any scope) for which to return its children. Must not be null.
Returns:
deferred iterator for the children of the given node. Never null

getParent

Deferred getParent(Object node)
Returns the parent of a given node.

Parameters:
node - node object or node uri (without any scope) for which to return its parent. Must not be null.
Returns:
a deferred object used to start this operation. The return value when executed through the deferred object is the parent of the given node, or null if the node has no parent


Copyright IBM Corp. 2010 All Rights Reserved.