com.infomancers.collections.tree
Class TreeModelAdapter

java.lang.Object
  extended by com.infomancers.collections.tree.TreeModelAdapter
All Implemented Interfaces:
TreeAdapter

public final class TreeModelAdapter
extends java.lang.Object
implements TreeAdapter

An adapter wrapping Swing's TreeModel.


Constructor Summary
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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeModelAdapter

public TreeModelAdapter()
Method Detail

getChildren

public 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.

Specified by:
getChildren in interface TreeAdapter
Parameters:
node - The node to retrieve the children for.
Returns:
The children nodes of the node.

getRoot

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

Cannot return null.

Specified by:
getRoot in interface TreeAdapter
Returns:
The root of the tree.