removing by object method added
This commit is contained in:
parent
b8092bd12f
commit
53bc5e9b8f
|
|
@ -30,6 +30,7 @@ import java.util.Collection;
|
|||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ru.touchin.roboswag.core.log.Lc;
|
||||
import rx.Observable;
|
||||
|
||||
/**
|
||||
|
|
@ -103,6 +104,22 @@ public class ObservableList<TItem> extends ObservableCollection<TItem> implement
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removing item.
|
||||
*
|
||||
* @param item Item to remove.
|
||||
*/
|
||||
public void remove(@NonNull final TItem item) {
|
||||
synchronized (this) {
|
||||
final int position = indexOf(item);
|
||||
if (position < 0) {
|
||||
Lc.assertion("Illegal removing of item " + item);
|
||||
return;
|
||||
}
|
||||
remove(position);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removing item by position.
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue