Java 类org.eclipse.emf.common.notify.impl.NotificationImpl 实例源码

项目:n4js    文件:N4JSResource.java   
/**
 * Creates a custom notification and sends it for proxy and loaded object. Registers adapters to loaded object.
 *
 * @param idx
 *            index in the contents list (first or second slot)
 * @param oldProxy
 *            the proxified object before being loaded
 */
protected void notifyProxyResolved(int idx, EObject oldProxy) {
    if (eNotificationRequired() && idx < contents.size()) {
        EObject newObject = contents.basicGet(idx);
        Notification notification = new NotificationImpl(Notification.RESOLVE, oldProxy, newObject) {
            @Override
            public Object getNotifier() {
                return N4JSResource.this;
            }

            @Override
            public int getFeatureID(Class<?> expectedClass) {
                return RESOURCE__CONTENTS;
            }
        };
        eNotify(notification);
        for (Adapter adapter : eAdapters()) {
            if (adapter instanceof EContentAdapter && !newObject.eAdapters().contains(adapter)) {
                newObject.eAdapters().add(adapter);
            }
        }
    }
}
项目:statecharts    文件:DerivedEObjectEList.java   
@Override
public boolean addAllUnique(int index, Collection<? extends E> objects) {
    int size = objects.size();

    if (size > 0) {

        if (isNotificationRequired()) {
            boolean oldIsSet = isSet();

            if (doAddAllUnique(index, objects)) {
                NotificationImpl notification = size == 1 ? createNotification(
                        Notification.ADD, null, objects.iterator().next(),
                        index, oldIsSet) : createNotification(
                        Notification.ADD_MANY, null, objects, index,
                        oldIsSet);
                dispatchNotification(notification);
                return true;
            }
        } else {
            return doAddAllUnique(index, objects);
        }
    }

    return false;
}
项目:statecharts    文件:DerivedEObjectEList.java   
@Override
public E remove(int index) {

    if (isNotificationRequired()) {
        boolean oldIsSet = isSet();
        NotificationImpl notification = createNotification(
                Notification.REMOVE, super.remove(index), null, index,
                oldIsSet);
        dispatchNotification(notification);
        @SuppressWarnings("unchecked")
        E oldValue = (E) notification.getOldValue();
        return oldValue;
    } else {
        return super.remove(index);
    }
}
项目:OpenSPIFe    文件:ProfileImpl.java   
/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated NOT
 */
@Override
@SuppressWarnings("unchecked")
public EList<DataPoint<T>> getDataPoints() {
    if (dataPoints == null) {
        dataPoints = new EDataTypeUniqueEList<DataPoint<T>>(DataPoint.class, this, JSciencePackage.PROFILE__DATA_POINTS) {

            @Override
            protected NotificationImpl createNotification(int eventType, boolean oldValue, boolean newValue) {
                return new TouchyNotification(owner, eventType, getFeatureID(), oldValue, newValue);
            }

            @Override
            protected NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index, boolean wasSet) {
                return new TouchyNotification(owner, eventType, getFeatureID(), oldObject, newObject, index, wasSet);
            }

            @Override
            protected NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index) {
                return new TouchyNotification(owner, eventType, getFeatureID(), oldObject, newObject, index);
            }

        };
    }
    return dataPoints;
}
项目:eclipse-avro    文件:ResourceImpl.java   
public void setURI(URI uri)
{
  URI oldURI = this.uri;
  this.uri = uri;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldURI, uri)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__URI;
        }
      };
    eNotify(notification);
  }
}
项目:eclipse-avro    文件:ResourceImpl.java   
public void setTimeStamp(long timeStamp)
{
  long oldTimeStamp = this.timeStamp;
  this.timeStamp = timeStamp;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__TIME_STAMP;
        }
      };
    eNotify(notification);
  }
}
项目:eclipse-avro    文件:ResourceImpl.java   
public void setModified(boolean isModified)
{
  boolean oldIsModified = this.isModified;
  this.isModified = isModified;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldIsModified, isModified)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__IS_MODIFIED;
        }
      };
    eNotify(notification);
  }
}
项目:clickwatch    文件:ResourceImpl.java   
public void setURI(URI uri)
{
  URI oldURI = this.uri;
  this.uri = uri;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldURI, uri)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__URI;
        }
      };
    eNotify(notification);
  }
}
项目:clickwatch    文件:ResourceImpl.java   
public void setTimeStamp(long timeStamp)
{
  long oldTimeStamp = this.timeStamp;
  this.timeStamp = timeStamp;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldTimeStamp, timeStamp)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__TIME_STAMP;
        }
      };
    eNotify(notification);
  }
}
项目:clickwatch    文件:ResourceImpl.java   
public void setModified(boolean isModified)
{
  boolean oldIsModified = this.isModified;
  this.isModified = isModified;
  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldIsModified, isModified)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__IS_MODIFIED;
        }
      };
    eNotify(notification);
  }
}
项目:statecharts    文件:DerivedEObjectEList.java   
@Override
public void addUnique(int index, E object) {

    if (isNotificationRequired()) {
        boolean oldIsSet = isSet();
        super.add(index, validate(index, object));
        NotificationImpl notification = createNotification(
                Notification.ADD, null, object, index, oldIsSet);
        dispatchNotification(notification);
    } else {
        super.add(index, validate(index, object));
    }
}
项目:eclipse-avro    文件:ResourceImpl.java   
/**
 * Sets the load state as indicated, and returns a notification, if {@link org.eclipse.emf.common.notify.impl.BasicNotifierImpl#eNotificationRequired required}.
 * Clients are <b>not</b> expected to call this directly; it is managed by the implementation.
 * @param isLoaded whether the resource is loaded.
 * @return a notification.
 */
protected Notification setLoaded(boolean isLoaded)
{
  boolean oldIsLoaded = this.isLoaded;
  this.isLoaded = isLoaded;

  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__IS_LOADED;
        }
      };
    return notification;
  }
  else
  {
    return null;
  }
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
public Object resolveProxy(EStructuralFeature feature, int entryIndex, int index, Object object)
{
  EObject resolved = resolveProxy((EObject)object);
  if (resolved != object)
  {
    Entry oldObject = (Entry)data[entryIndex];
    Entry entry = createEntry(feature, resolved);
    assign(entryIndex, validate(entryIndex, entry));
    didSet(entryIndex, entry, oldObject);

    if (isNotificationRequired())
    {
      NotificationImpl notifications = 
        createNotification
          (Notification.RESOLVE, 
           entry.getEStructuralFeature(), 
           object,
           resolved,
           index,
           false);

      notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
      notifications.dispatch();
    }

    return resolved;
  }

  return object;
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
public NotificationChain shadowAdd(FeatureMap.Entry.Internal entry, NotificationChain notifications)
{
  EStructuralFeature feature = entry.getEStructuralFeature();
  Object value = entry.getValue();
  // EATM must fix isSet bits.
  NotificationImpl notification = 
    feature.isMany() ?
      createNotification
        (Notification.ADD,
         feature,
         null, 
         value,
         indexOf(feature, value),
         true) :
      createNotification
        (Notification.SET, 
         feature,
         feature.getDefaultValue(), 
         value,
         Notification.NO_INDEX,
         true);

  if (notifications != null)
  {
    notifications.add(notification);
  }
  else
  {
    notifications = notification;
  }
  return notifications;
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
public NotificationChain shadowRemove(FeatureMap.Entry.Internal entry, NotificationChain notifications)
{
  EStructuralFeature feature = entry.getEStructuralFeature();
  Object value = entry.getValue();
  NotificationImpl notification = 
    feature.isMany() ?
      createNotification
        (Notification.REMOVE,
         feature,
         value,
         null, 
         indexOf(feature, value),
         true) :
      createNotification
        (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
         feature,
         value,
         feature.getDefaultValue(), 
         Notification.NO_INDEX,
         true);

  if (notifications != null)
  {
    notifications.add(notification);
  }
  else
  {
    notifications = notification;
  }

  return notifications;
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
@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;
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
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;
}
项目:eclipse-avro    文件:DelegatingFeatureMap.java   
public Object resolveProxy(EStructuralFeature feature, int entryIndex, int index, Object object)
{
  EObject resolved = resolveProxy((EObject)object);
  if (resolved != object)
  {
    Entry oldObject = delegateGet(entryIndex);
    Entry entry = createEntry(feature, resolved);
    delegateSet(entryIndex, validate(entryIndex, entry));
    didSet(entryIndex, entry, oldObject);

    if (isNotificationRequired())
    {
      NotificationImpl notifications = 
        createNotification
          (Notification.RESOLVE, 
           entry.getEStructuralFeature(), 
           object,
           resolved,
           index,
           false);

      notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
      notifications.dispatch();
    }

    return resolved;
  }

  return object;
}
项目:eclipse-avro    文件:DelegatingFeatureMap.java   
@Override
public NotificationChain shadowAdd(Entry object, NotificationChain notifications)
{
  if (isNotificationRequired())
  {
    EStructuralFeature feature = object.getEStructuralFeature();
    Object value = object.getValue();
    // EATM must fix isSet bits.
    NotificationImpl notification = 
      feature.isMany() ?
        createNotification
          (Notification.ADD,
           feature,
           null, 
           value,
           indexOf(feature, value),
           true) :
        createNotification
          (Notification.SET, 
           feature,
           feature.getDefaultValue(), 
           value,
           Notification.NO_INDEX,
           true);

    if (notifications != null)
    {
      notifications.add(notification);
    }
    else
    {
      notifications = notification;
    }
  }
  return notifications;
}
项目:eclipse-avro    文件:DelegatingFeatureMap.java   
@Override
public NotificationChain shadowRemove(Entry object, NotificationChain notifications)
{
  if (isNotificationRequired())
  {
    EStructuralFeature feature = object.getEStructuralFeature();
    Object value = object.getValue();
    NotificationImpl notification = 
      feature.isMany() ?
        createNotification
          (Notification.REMOVE,
           feature,
           value,
           null, 
           indexOf(feature, value),
           true) :
        createNotification
          (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
           feature,
           value,
           feature.getDefaultValue(), 
           Notification.NO_INDEX,
           true);

    if (notifications != null)
    {
      notifications.add(notification);
    }
    else
    {
      notifications = notification;
    }
  }
  return notifications;
}
项目:eclipse-avro    文件:DelegatingFeatureMap.java   
@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;
}
项目:eclipse-avro    文件:DelegatingFeatureMap.java   
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;
}
项目:clickwatch    文件:ResourceImpl.java   
/**
 * Sets the load state as indicated, and returns a notification, if {@link org.eclipse.emf.common.notify.impl.BasicNotifierImpl#eNotificationRequired required}.
 * Clients are <b>not</b> expected to call this directly; it is managed by the implementation.
 * @param isLoaded whether the resource is loaded.
 * @return a notification.
 */
protected Notification setLoaded(boolean isLoaded)
{
  boolean oldIsLoaded = this.isLoaded;
  this.isLoaded = isLoaded;

  if (eNotificationRequired())
  {
    Notification notification =
      new NotificationImpl(Notification.SET, oldIsLoaded, isLoaded)
      {
        @Override
        public Object getNotifier()
        {
          return ResourceImpl.this;
        }

        @Override
        public int getFeatureID(Class<?> expectedClass)
        {
          return RESOURCE__IS_LOADED;
        }
      };
    return notification;
  }
  else
  {
    return null;
  }
}
项目:clickwatch    文件:BasicFeatureMap.java   
public Object resolveProxy(EStructuralFeature feature, int entryIndex, int index, Object object)
{
  EObject resolved = resolveProxy((EObject)object);
  if (resolved != object)
  {
    Entry oldObject = (Entry)data[entryIndex];
    Entry entry = createEntry(feature, resolved);
    assign(entryIndex, validate(entryIndex, entry));
    didSet(entryIndex, entry, oldObject);

    if (isNotificationRequired())
    {
      NotificationImpl notifications = 
        createNotification
          (Notification.RESOLVE, 
           entry.getEStructuralFeature(), 
           object,
           resolved,
           index,
           false);

      notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
      notifications.dispatch();
    }

    return resolved;
  }

  return object;
}
项目:clickwatch    文件:BasicFeatureMap.java   
public NotificationChain shadowAdd(FeatureMap.Entry.Internal entry, NotificationChain notifications)
{
  EStructuralFeature feature = entry.getEStructuralFeature();
  Object value = entry.getValue();
  // EATM must fix isSet bits.
  NotificationImpl notification = 
    feature.isMany() ?
      createNotification
        (Notification.ADD,
         feature,
         null, 
         value,
         indexOf(feature, value),
         true) :
      createNotification
        (Notification.SET, 
         feature,
         feature.getDefaultValue(), 
         value,
         Notification.NO_INDEX,
         true);

  if (notifications != null)
  {
    notifications.add(notification);
  }
  else
  {
    notifications = notification;
  }
  return notifications;
}
项目:clickwatch    文件:BasicFeatureMap.java   
public NotificationChain shadowRemove(FeatureMap.Entry.Internal entry, NotificationChain notifications)
{
  EStructuralFeature feature = entry.getEStructuralFeature();
  Object value = entry.getValue();
  NotificationImpl notification = 
    feature.isMany() ?
      createNotification
        (Notification.REMOVE,
         feature,
         value,
         null, 
         indexOf(feature, value),
         true) :
      createNotification
        (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
         feature,
         value,
         feature.getDefaultValue(), 
         Notification.NO_INDEX,
         true);

  if (notifications != null)
  {
    notifications.add(notification);
  }
  else
  {
    notifications = notification;
  }

  return notifications;
}
项目:clickwatch    文件:BasicFeatureMap.java   
@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;
}
项目:clickwatch    文件:BasicFeatureMap.java   
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;
}
项目:clickwatch    文件:DelegatingFeatureMap.java   
public Object resolveProxy(EStructuralFeature feature, int entryIndex, int index, Object object)
{
  EObject resolved = resolveProxy((EObject)object);
  if (resolved != object)
  {
    Entry oldObject = delegateGet(entryIndex);
    Entry entry = createEntry(feature, resolved);
    delegateSet(entryIndex, validate(entryIndex, entry));
    didSet(entryIndex, entry, oldObject);

    if (isNotificationRequired())
    {
      NotificationImpl notifications = 
        createNotification
          (Notification.RESOLVE, 
           entry.getEStructuralFeature(), 
           object,
           resolved,
           index,
           false);

      notifications.add(createNotification(Notification.RESOLVE, oldObject, entry, index, false));
      notifications.dispatch();
    }

    return resolved;
  }

  return object;
}
项目:clickwatch    文件:DelegatingFeatureMap.java   
@Override
public NotificationChain shadowAdd(Entry object, NotificationChain notifications)
{
  if (isNotificationRequired())
  {
    EStructuralFeature feature = object.getEStructuralFeature();
    Object value = object.getValue();
    // EATM must fix isSet bits.
    NotificationImpl notification = 
      feature.isMany() ?
        createNotification
          (Notification.ADD,
           feature,
           null, 
           value,
           indexOf(feature, value),
           true) :
        createNotification
          (Notification.SET, 
           feature,
           feature.getDefaultValue(), 
           value,
           Notification.NO_INDEX,
           true);

    if (notifications != null)
    {
      notifications.add(notification);
    }
    else
    {
      notifications = notification;
    }
  }
  return notifications;
}
项目:clickwatch    文件:DelegatingFeatureMap.java   
@Override
public NotificationChain shadowRemove(Entry object, NotificationChain notifications)
{
  if (isNotificationRequired())
  {
    EStructuralFeature feature = object.getEStructuralFeature();
    Object value = object.getValue();
    NotificationImpl notification = 
      feature.isMany() ?
        createNotification
          (Notification.REMOVE,
           feature,
           value,
           null, 
           indexOf(feature, value),
           true) :
        createNotification
          (feature.isUnsettable() ? Notification.UNSET : Notification.SET, 
           feature,
           value,
           feature.getDefaultValue(), 
           Notification.NO_INDEX,
           true);

    if (notifications != null)
    {
      notifications.add(notification);
    }
    else
    {
      notifications = notification;
    }
  }
  return notifications;
}
项目:clickwatch    文件:DelegatingFeatureMap.java   
@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;
}
项目:clickwatch    文件:DelegatingFeatureMap.java   
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;
}
项目:statecharts    文件:DerivedEObjectEList.java   
protected NotificationImpl createNotification(int eventType,
        Object oldObject, Object newObject, int index, boolean wasSet) {
    return new ENotificationImpl(owner, eventType, featureID, oldObject,
            newObject, index, wasSet);
}
项目:emfstore-rest    文件:NotificationToOperationConverterTest.java   
/**
 * Test an invalid event type.
 */
@Test
public void invalidEventType() {
    Assert.assertNull(converter.convert(new NotificationInfo(new NotificationImpl(Integer.MIN_VALUE, null, null))));

}
项目:emfstore-rest    文件:NotificationToOperationConverterTest.java   
/**
 * Test a notification which is only touch.
 */
@Test
public void onlyTouch() {
    Assert.assertNull(converter
        .convert(new NotificationInfo(new NotificationImpl(Notification.RESOLVE, null, null))));
}
项目:eclipse-avro    文件:DelegatingEcoreEList.java   
@Override
protected NotificationImpl createNotification(int eventType, Object oldObject, Object newObject, int index, boolean wasSet)
{
  return new ENotificationImpl(owner, eventType, getFeatureID(), oldObject, newObject, index, wasSet);
}
项目:eclipse-avro    文件:DelegatingEcoreEList.java   
protected NotificationImpl createNotification(int eventType, boolean oldValue, boolean newValue)
{
  return new ENotificationImpl(owner, eventType, getFeatureID(), oldValue, newValue);
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
protected NotificationImpl createNotification
  (int eventType, EStructuralFeature feature, Object oldObject, Object newObject, int index, boolean wasSet)
{
  return new FeatureMapUtil.FeatureENotificationImpl(owner, eventType, feature, oldObject, newObject, index, wasSet);
}
项目:eclipse-avro    文件:BasicFeatureMap.java   
@Override
public NotificationChain basicRemove(Object object, NotificationChain notifications)
{
  // This may be called directly on an EObject for the case of a containment.
  //
  if (object instanceof FeatureMap.Entry)
  {
    return super.basicRemove(object, notifications);
  }
  else
  {
    Entry match = null;
    EStructuralFeature feature = null;
    Entry [] entries = (Entry[])data;
    for (int i = 0; i < size; ++i)
    {
      Entry entry = entries[i];
      if (object.equals(entry.getValue()))
      {
        feature = entry.getEStructuralFeature();
        if (feature instanceof EReference && ((EReference)feature).isContainment())
        {
          match = entry;
          break;
        }
      }
    }

    if (match != null)
    {
      if (isNotificationRequired())
      {
        @SuppressWarnings("null")
        NotificationImpl notification =
          feature.isMany() ?
            createNotification
              (Notification.REMOVE,
               feature,
               object,
               null,
               indexOf(feature, object),
               true) :
            createNotification
              (feature.isUnsettable() ? Notification.UNSET : Notification.SET,
               feature,
               object,
               feature.getDefaultValue(),
               Notification.NO_INDEX,
               true);

        if (notifications != null)
        {
          notifications.add(notification);
        }
        else
        {
          notifications = notification;
        }
      }
      notifications = basicRemove(match, notifications);
    }

    return notifications;
  }
}