public class GenericItemAdapter<Model,Item extends GenericAbstractItem<Model,Item,?>> extends ItemAdapter<Item>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
GenericItemAdapter.ReflectionBasedItemFactory<Model,Item> |
ItemAdapter.ItemFilterIItemAdapter.Predicate<Item extends IItem>| Constructor and Description |
|---|
GenericItemAdapter(java.lang.Class<? extends Item> itemClass,
java.lang.Class<? extends Model> modelClass) |
GenericItemAdapter(Function<Model,Item> itemFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
addModel(int position,
java.util.List<Model> models)
add a list of models at a given (global) position
|
void |
addModel(int position,
Model... models)
add an array of models at a given (global) position
|
void |
addModel(java.util.List<Model> models)
add a list of models
|
void |
addModel(Model... models)
add an array of models
|
void |
clearModel()
clear all models
|
void |
removeModel(int position)
remove a model at the given (global) position
|
void |
removeModelRange(int position,
int itemCount)
remove a range oof model items starting with the (global) position and the size
|
void |
setModel(int position,
Model model)
set a model at a given position
|
void |
setModel(java.util.List<Model> models)
set a new list of models for this adapter
|
void |
setNewModel(java.util.List<Model> models)
sets a complete new list of items onto this adapter, using the new list.
|
protected Item |
toItem(Model model)
gets an instance of our TypedItem from a Model
|
protected java.util.List<Item> |
toItems(java.util.List<Model> models)
helper to get a list of item from a list o model
|
add, add, add, add, clear, filter, getAdapterItem, getAdapterItemCount, getAdapterItems, getAdapterPosition, getGlobalPosition, getItemFilter, getOrder, remove, removeRange, set, set, setNewList, setSubItems, withFilterPredicate, withUseIdDistributorgetFastAdapter, getItem, getItemCount, getItemId, getItemViewType, mapPossibleType, mapPossibleTypes, onAttachedToRecyclerView, onBindViewHolder, onBindViewHolder, onCreateViewHolder, onDetachedFromRecyclerView, onFailedToRecycleView, onViewAttachedToWindow, onViewDetachedFromWindow, onViewRecycled, registerAdapterDataObserver, setHasStableIds, unregisterAdapterDataObserver, wrap, wrapbindViewHolder, createViewHolder, hasObservers, hasStableIds, notifyDataSetChanged, notifyItemChanged, notifyItemChanged, notifyItemInserted, notifyItemMoved, notifyItemRangeChanged, notifyItemRangeChanged, notifyItemRangeInserted, notifyItemRangeRemoved, notifyItemRemovedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFastAdapter, getItem, getItemCountpublic GenericItemAdapter(java.lang.Class<? extends Item> itemClass, java.lang.Class<? extends Model> modelClass)
itemClass - the class of your item (Item extends GenericAbstractItem)modelClass - the class which is your model classpublic void setModel(java.util.List<Model> models)
models - the set modelspublic void setNewModel(java.util.List<Model> models)
models - the set models@SafeVarargs public final void addModel(Model... models)
models - the added modelspublic void addModel(java.util.List<Model> models)
models - the added models@SafeVarargs
public final void addModel(int position,
Model... models)
position - the global positionmodels - the added modelspublic void addModel(int position,
java.util.List<Model> models)
position - the global positionmodels - the added modelspublic void setModel(int position,
Model model)
position - the global positionmodel - the set modelpublic void clearModel()
public void removeModelRange(int position,
int itemCount)
position - the global positionitemCount - the count of items which were removedpublic void removeModel(int position)
position - the global positionprotected java.util.List<Item> toItems(java.util.List<Model> models)
models - the models