/**
* Returns the resolved object from this list for the purpose of testing whether {@link #removeAll(Collection)} applies to it.
* @param object the object to be resolved.
* @return the resolved object from this list for the purpose of testing whether removeAll applies to it.
*/
protected E resolve(E object) {
return object;
}
/**
* Removes each object of the collection from the list and returns whether any object was actually contained by the list;
* it does no inverse updating, or notification.
* @param collection the collection of objects to be removed.
* @return whether any object was actually contained by the list.
*/
protected boolean doRemoveAll(Collection<? > collection) {
return super.removeAll(collection);
}
/**
* Removes the object from the list and returns the potentially updated notification chain;
* it does no {@link #inverseRemove inverse} updating.
* This implementation generates notifications as {@link #isNotificationRequired required}.
* @param object the object to be removed.
* @return the notification chain.
* @see #isNotificationRequired
* @see #hasInverse
* @see #inverseRemove
*/
public NotificationChain basicRemove(Object object, NotificationChain notifications) {
int index = indexOf(object);
if (index != -1) {
if (isNotificationRequired()) {
boolean oldIsSet = isSet();
Object oldObject = doRemove(index);
NotificationImpl notification = createNotification(Notification.REMOVE, oldObject, null, index, oldIsSet);
if (notifications == null) {
notifications = notification;
}
else {
notifications.add(notification);
}
}
else {
doRemove(index);
}
}
return notifications;
}
|