예제 #1
0
 /**
  * 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);
 }
예제 #2
0
 /**
  * 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());
 }
예제 #3
0
 /**
  * set a new list of items for this adapter
  *
  * @param items
  */
 public void set(List<IItem> items) {
   if (mUseIdDistributor) {
     IdDistributor.checkIds(items);
   }
   mItems = items;
   mapPossibleTypes(mItems);
   getFastAdapter()
       .notifyAdapterItemRangeChanged(
           getFastAdapter().getItemCount(getOrder()), getAdapterItemCount());
 }
예제 #4
0
 /**
  * add a list of items to the end of the existing items
  *
  * @param items
  */
 public void add(List<IItem> items) {
   if (items != null) {
     if (mUseIdDistributor) {
       IdDistributor.checkIds(items);
     }
     mItems.addAll(items);
     mapPossibleTypes(items);
     getFastAdapter()
         .notifyAdapterItemRangeInserted(getFastAdapter().getItemCount(getOrder()), items.size());
   }
 }
예제 #5
0
 /**
  * add an array of items to the end of the existing items
  *
  * @param items
  */
 public void add(IItem... items) {
   if (items != null) {
     if (mUseIdDistributor) {
       IdDistributor.checkIds(items);
     }
     Collections.addAll(mItems, items);
     mapPossibleTypes(Arrays.asList(items));
     getFastAdapter()
         .notifyAdapterItemRangeInserted(getFastAdapter().getItemCount(getOrder()), items.length);
   }
 }