DataType - The type of the data, which should be loadedKeyType - The type of the keys, which allow to identify the dataViewType - The type of the views, which are able to show the dataParamType - The type of parameters, which can optionally be passed to the loaderpublic abstract class AbstractDataLoader<DataType,KeyType,ViewType extends android.view.View,ParamType>
extends java.lang.Object
| Constructor and Description |
|---|
AbstractDataLoader(android.content.Context context)
Creates a new data loader, which allows to asynchronously load data and show it in a view
afterwards.
|
| Modifier and Type | Method and Description |
|---|---|
protected android.content.Context |
getContext()
Returns the context, which is used by the data loader.
|
void |
load(KeyType key,
ViewType view,
ParamType... params)
Loads the the data, which corresponds to a specific key, and shows it in a specific view
afterwards.
|
protected abstract DataType |
loadData(KeyType key,
ParamType... params)
The method, which is invoked on implementing subclasses, in order to load the data, which
corresponds to a specific key.
|
protected abstract void |
showData(ViewType view,
DataType data)
The method, which is invoked on implementing subclasses, in order to show data after it has
been loaded.
|
public AbstractDataLoader(android.content.Context context)
context - The context, which should be used by the data loader, as an instance of the class
Context. The context may not be nullprotected final android.content.Context getContext()
Contextprotected abstract DataType loadData(KeyType key, ParamType... params)
key - The key of the data, which should be loaded, as an instance of the generic type
KeyType. The key may not be nullparams - An array, which may contain optional parameters, as an array of the generic type
ParamTypeprotected abstract void showData(ViewType view, DataType data)
view - The view, which should be used to show the data after it has been loaded, as an
instance of the generic type ViewType. The view may not be nulldata - The data, which should be shown, as an instance of the generic type DataType. The
data may not be null@SafeVarargs public final void load(KeyType key, ViewType view, ParamType... params)
key - The key of the data, which should be loaded, as an instance of the generic type
KeyType. The key may not be nullview - The view, which should be used to show the data after it has been loaded, as an
instance of the generic type ViewType. The view may not be nullparams - An array, which may contain optional parameters, as an array of the generic type
ParamType