@Override public NotificationChain shadowSet(Entry oldObject, Entry newObject, NotificationChain notifications) {
if (isNotificationRequired()) {
EStructuralFeature feature = oldObject.getEStructuralFeature();
Object oldValue = oldObject.getValue();
Object newValue = newObject.getValue();
NotificationImpl notification = createNotification(Notification.SET, feature, oldValue, newValue, feature.isMany() ? indexOf(feature, newValue): Notification.NO_INDEX, true);
if (notifications != null) {
notifications.add(notification);
}
else {
notifications = notification;
}
}
return notifications;
}
public NotificationChain inverseTouch(Object object, NotificationChain notifications) {
if (isNotificationRequired()) {
Entry entry = (Entry) object;
EStructuralFeature feature = entry.getEStructuralFeature();
Object value = entry.getValue();
NotificationImpl notification = createNotification(Notification.SET, feature, value, value, feature.isMany() ? indexOf(feature, value): Notification.NO_INDEX, true);
if (notifications != null) {
notifications.add(notification);
}
else {
notifications = notification;
}
}
return notifications;
}
|