T - public class ListDataProvider<T extends Serializable> extends Object implements IDataProvider<T>
DataView. The only requirement is that either list items
must be serializable or model(Object) needs to be overridden to provide the proper model
implementation.| Constructor and Description |
|---|
ListDataProvider()
Constructs an empty provider.
|
ListDataProvider(List<T> list) |
| Modifier and Type | Method and Description |
|---|---|
void |
detach()
Detaches model after use.
|
protected List<T> |
getData()
Subclass to lazy load the list
|
Iterator<? extends T> |
iterator(long first,
long count)
Gets an iterator for the subset of total data
|
IModel<T> |
model(T object)
Callback used by the consumer of this data provider to wrap objects retrieved from
IDataProvider.iterator(long, long) with a model (usually a detachable one). |
long |
size()
Gets total number of items in the collection represented by the DataProvider
|
public ListDataProvider()
public Iterator<? extends T> iterator(long first, long count)
IDataProvideriterator in interface IDataProvider<T extends Serializable>first - first row of datacount - minimum number of elements to retrievepublic long size()
IDataProvidersize in interface IDataProvider<T extends Serializable>IDataProvider.size()public IModel<T> model(T object)
IDataProviderIDataProvider.iterator(long, long) with a model (usually a detachable one).model in interface IDataProvider<T extends Serializable>object - the object that needs to be wrappedIDataProvider.model(Object)public void detach()
IDetachabledetach in interface IDetachableIDetachable.detach()Copyright © 2006–2014 Apache Software Foundation. All rights reserved.