com.infomancers.collections.tree
Interface TreeAdapter

All Known Implementing Classes:
DOMAdapter, TreeModelAdapter

public interface TreeAdapter

Used as an adapter between an already existing tree model and this collections library.

A few well known trees already have implementations in this library, such as TreeModelAdapter for Swing's TreeModel interface and DOMAdapter for XML DOM.

See Also:
DOMAdapter, TreeModelAdapter

Method Summary
 java.lang.Iterable<java.lang.Object> getChildren(java.lang.Object node)
          Retrieves the children of the node specified.
 java.lang.Object getRoot()
          Retrieves the root of the tree.
 

Method Detail

getChildren

java.lang.Iterable<java.lang.Object> getChildren(java.lang.Object node)
Retrieves the children of the node specified. If the node has no children (is a leaf), an empty iterable is returned.

Cannot return null.

Parameters:
node - The node to retrieve the children for.
Returns:
The children nodes of the node.

getRoot

java.lang.Object getRoot()
Retrieves the root of the tree.

Cannot return null.

Returns:
The root of the tree.