lazyj.widgets
Interface TreeProvider<K,V>

Type Parameters:
K - key type (usually Integer)
V - value type (usually String)
All Known Implementing Classes:
BasicDBTreeProvider, DBTreeProvider

public interface TreeProvider<K,V>

Provide nodes for the Tree.

Since:
Nov 26, 2007 (1.0.4)
Author:
costing

Method Summary
 K getKey()
          Get the key object (unique identifier of the node).
 K getParent()
          Get the parent id (should match the getKey() for another entry).
 V getValue()
          Get the value that is to be displayed for this node.
 boolean moveNext()
          Go to the next entry in the list.
 

Method Detail

getKey

K getKey()
Get the key object (unique identifier of the node).

Returns:
key

getParent

K getParent()
Get the parent id (should match the getKey() for another entry).

Returns:
parent key

getValue

V getValue()
Get the value that is to be displayed for this node.

Returns:
value

moveNext

boolean moveNext()
Go to the next entry in the list. Take care if you use DBFunctions.moveNext() to implement this function because the first call is dummy on database rows while here it is expected to actually do something from the first call. The easy way out is to do a moveNext on the database result after executing the query and before building the tree from it.

Returns:
true if move was possible
See Also:
DBFunctions.moveNext()