Interface used to provide data to data views. Example:
class UsersProvider implements IDataProvider { public Iterator iterator(int first, int count) { ((MyApplication)Application.get()).getUserDao().iterator(first, count); } public int size() { ((MyApplication)Application.get()).getUserDao().getCount(); } public IModel model(Object object) { return new DetachableUserModel((User)object); } }
You can use the {@link IDetachable#detach()} method for cleaning up your IDataProvider instance.So that you can do one query that returns both the size and the values if your dataset is small enough the be able to do that.
@see IDetachable
@see DataViewBase
@see DataView
@see GridView
@author Igor Vaynberg (ivaynberg)
@param < T>