/** * sets an item at the given position, overwriting the previous item * * @param position the relative position (position of this adapter) * @param item */ public void set(int position, IItem item) { if (mUseIdDistributor) { IdDistributor.checkId(item); } mItems.set(position, item); mapPossibleType(item); getFastAdapter().notifyAdapterItemChanged(getFastAdapter().getItemCount(getOrder()) + position); }
/** * add an item at the end of the existing items * * @param item */ public void add(IItem item) { if (mUseIdDistributor) { IdDistributor.checkId(item); } mItems.add(item); mapPossibleType(item); getFastAdapter() .notifyAdapterItemInserted(getFastAdapter().getItemCount(getOrder()) + mItems.size()); }