removing by object method added

This commit is contained in:
Gavriil Sitnikov 2016-09-07 17:30:43 +03:00
parent b8092bd12f
commit 53bc5e9b8f
1 changed files with 17 additions and 0 deletions

View File

@ -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.
*