public class FooProvider extends Object implements ITreeProvider<Foo>
Foo
s.
For simplicity all foos are kept as class members, in a real world scenario these would be
fetched from a database. If Foo
s were Serializable
you could of course just keep
references in instance variables.model(Foo)
,
Serialized FormConstructor and Description |
---|
FooProvider()
Construct.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Nothing to do.
|
Iterator<Foo> |
getChildren(Foo foo)
Get the children of the given node.
|
Iterator<Foo> |
getRoots()
Get the roots of the tree.
|
boolean |
hasChildren(Foo foo)
Does the given object have children - note that this method may return
true even
if ITreeProvider.getChildren(Object) returns an empty iterator. |
IModel<Foo> |
model(Foo foo)
Creates a
FooModel . |
public void detach()
detach
in interface IDetachable
public Iterator<Foo> getRoots()
ITreeProvider
getRoots
in interface ITreeProvider<Foo>
public boolean hasChildren(Foo foo)
ITreeProvider
true
even
if ITreeProvider.getChildren(Object)
returns an empty iterator.hasChildren
in interface ITreeProvider<Foo>
foo
- the node to check for childrentrue
if node has childrenpublic Iterator<Foo> getChildren(Foo foo)
ITreeProvider
getChildren
in interface ITreeProvider<Foo>
foo
- node to get children forCopyright © 2006–2022 Apache Software Foundation. All rights reserved.