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.ItemFilter, ItemAdapter.ItemFilterListenerIItemAdapter.Predicate<Item extends IItem>mComparator, mItemFilterListener| 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 |
|---|---|
GenericItemAdapter<Model,Item> |
addModel(int position,
java.util.List<Model> models)
add a list of models at a given (global) position
|
GenericItemAdapter<Model,Item> |
addModel(int position,
Model... models)
add an array of models at a given (global) position
|
GenericItemAdapter<Model,Item> |
addModel(java.util.List<Model> models)
add a list of models
|
GenericItemAdapter<Model,Item> |
addModel(Model... models)
add an array of models
|
GenericItemAdapter<Model,Item> |
clearModel()
clear all models
|
java.util.List<Model> |
getModels()
returns the list of the model generated from the list of items
|
GenericItemAdapter<Model,Item> |
removeModel(int position)
remove a model at the given (global) position
|
GenericItemAdapter<Model,Item> |
removeModelRange(int position,
int itemCount)
remove a range oof model items starting with the (global) position and the size
|
GenericItemAdapter<Model,Item> |
setModel(int position,
Model model)
set a model at a given position
|
GenericItemAdapter<Model,Item> |
setModel(java.util.List<Model> models)
set a new list of models for this adapter
|
GenericItemAdapter<Model,Item> |
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, getComparator, getGlobalPosition, getItemFilter, getOrder, move, remove, removeRange, set, set, setNewList, setSubItems, withComparator, withComparator, withFilterPredicate, withItemFilterListener, 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 java.util.List<Model> getModels()
public GenericItemAdapter<Model,Item> setModel(java.util.List<Model> models)
models - the set modelspublic GenericItemAdapter<Model,Item> setNewModel(java.util.List<Model> models)
models - the set models@SafeVarargs public final GenericItemAdapter<Model,Item> addModel(Model... models)
models - the added modelspublic GenericItemAdapter<Model,Item> addModel(java.util.List<Model> models)
models - the added models@SafeVarargs public final GenericItemAdapter<Model,Item> addModel(int position, Model... models)
position - the global positionmodels - the added modelspublic GenericItemAdapter<Model,Item> addModel(int position, java.util.List<Model> models)
position - the global positionmodels - the added modelspublic GenericItemAdapter<Model,Item> setModel(int position, Model model)
position - the global positionmodel - the set modelpublic GenericItemAdapter<Model,Item> clearModel()
public GenericItemAdapter<Model,Item> removeModelRange(int position, int itemCount)
position - the global positionitemCount - the count of items which were removedpublic GenericItemAdapter<Model,Item> removeModel(int position)
position - the global positionprotected java.util.List<Item> toItems(java.util.List<Model> models)
models - the models