org.databene.commons.tree
Class ChildTreeModel<I,V>

java.lang.Object
  extended by org.databene.commons.tree.ChildTreeModel<I,V>
All Implemented Interfaces:
TreeModel<V>

public class ChildTreeModel<I,V>
extends java.lang.Object
implements TreeModel<V>

Adapts a ChildModel to a TreeModel.

Created: 31.07.2007 06:32:41

Author:
Volker Bergmann

Constructor Summary
ChildTreeModel()
           
ChildTreeModel(ChildModel<I,V> childModel)
           
 
Method Summary
 void add(V element)
           
 V getChild(V parent, int index)
           
 int getChildCount(V parent)
           
 int getIndexOfChild(V parent, V child)
           
 V getParent(V child)
           
 V getRoot()
           
 boolean isLeaf(V node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChildTreeModel

public ChildTreeModel()

ChildTreeModel

public ChildTreeModel(ChildModel<I,V> childModel)
Method Detail

add

public void add(V element)

getRoot

public V getRoot()
Specified by:
getRoot in interface TreeModel<V>

getParent

public V getParent(V child)
Specified by:
getParent in interface TreeModel<V>

getChild

public V getChild(V parent,
                  int index)
Specified by:
getChild in interface TreeModel<V>

getChildCount

public int getChildCount(V parent)
Specified by:
getChildCount in interface TreeModel<V>

isLeaf

public boolean isLeaf(V node)
Specified by:
isLeaf in interface TreeModel<V>

getIndexOfChild

public int getIndexOfChild(V parent,
                           V child)
Specified by:
getIndexOfChild in interface TreeModel<V>


Copyright © 2010. All Rights Reserved.