public abstract class FetchedArrayViewModel<E extends IViewModel,P> extends ConstantArrayViewModel<E> implements IFetchedArrayViewModel<E,P,java.lang.Void,java.util.Collection<E>>
IFetchedArrayViewModel that fetches ViewModels by calling onFetch(Object)| Constructor and Description |
|---|
FetchedArrayViewModel() |
| Modifier and Type | Method and Description |
|---|---|
protected ICommand<java.lang.Void,java.util.Collection<E>> |
createFetchCommand() |
protected ICommand<java.lang.Void,java.util.Collection<E>> |
createFetchIfNeededCommand() |
protected ICommand<java.lang.Void,java.util.Collection<E>> |
createRefreshCommand() |
IProperty<java.lang.Boolean> |
fetchingNextPage() |
ICommand<java.lang.Void,java.util.Collection<E>> |
getFetchCommand() |
ICommand<java.lang.Void,java.util.Collection<E>> |
getFetchIfNeededCommand() |
P |
getNextPage() |
ICommand<java.lang.Void,java.util.Collection<E>> |
getRefreshCommand() |
IProperty<java.lang.Boolean> |
hasNextPage() |
protected abstract rx.Observable<Pair<P,java.util.Collection<E>>> |
onFetch(P page)
Implement this method to fetch ViewModels at
page |
IProperty<java.lang.Boolean> |
refreshing() |
protected void |
setNextPage(P nextPage) |
count, empty, getViewModel, getViewModels, indexOf, iterator, localizedEmptyMessage, setViewModelsactive, bindCommand, bindErrors, bindLoading, enabled, errors, loading, titleclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcount, empty, getViewModel, getViewModels, indexOf, localizedEmptyMessageactive, bindCommand, bindErrors, bindLoading, enabled, errors, loading, titleprotected abstract rx.Observable<Pair<P,java.util.Collection<E>>> onFetch(P page)
pagepublic final IProperty<java.lang.Boolean> refreshing()
refreshing in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>public P getNextPage()
getNextPage in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>protected void setNextPage(P nextPage)
public final IProperty<java.lang.Boolean> fetchingNextPage()
fetchingNextPage in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>public final IProperty<java.lang.Boolean> hasNextPage()
hasNextPage in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>public final ICommand<java.lang.Void,java.util.Collection<E>> getRefreshCommand()
getRefreshCommand in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>public final ICommand<java.lang.Void,java.util.Collection<E>> getFetchCommand()
getFetchCommand in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>nextPage is null, this command will refresh, else this command should fetch next page.public final ICommand<java.lang.Void,java.util.Collection<E>> getFetchIfNeededCommand()
getFetchIfNeededCommand in interface IFetchedArrayViewModel<E extends IViewModel,P,java.lang.Void,java.util.Collection<E extends IViewModel>>IFetchedArrayViewModel.getFetchCommand() only if next page is non null or returns Observable.empty()protected ICommand<java.lang.Void,java.util.Collection<E>> createRefreshCommand()