public class GenericItemAdapter<Model,Item extends IGenericItem<? extends Model,?,?>> extends ItemAdapter<Item>
IItemAdapter.Predicate<Item extends IItem>mComparator| Constructor and Description |
|---|
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> |
moveModel(int fromPosition,
int toPosition)
moves an model within the list from a position to a position
|
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, getAdapterPosition, getComparator, getGlobalPosition, getItemFilter, getOrder, isUseIdDistributor, move, remapMappedTypes, remove, removeRange, set, set, set, setNewList, setNewList, setSubItems, withComparator, withComparator, withItemFilter, withUseIdDistributorclearMappedTypes, getFastAdapter, 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 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> moveModel(int fromPosition, int toPosition)
fromPosition - the position global from which we want to movetoPosition - the global position to which to movepublic 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