public final void set ( final int index , @ NonNull final AbstractItem item ) { Condition . INSTANCE . ensureNotNull ( item , "The item may not be null" ) ; AbstractItem replacedItem = items . set ( index , item ) ; if ( replacedItem instanceof Item && ( ( Item ) replacedItem ) . getIcon ( ) != null ) { iconCount -- ; } else if ( replacedItem instanceof Divider ) { dividerCount -- ; } if ( item instanceof Item && ( ( Item ) item ) . getIcon ( ) != null ) { iconCount ++ ; } else if ( item instanceof Divider ) { dividerCount ++ ; } rawItems = null ; notifyOnDataSetChanged ( ) ; }
Replaces the item with at a specific index