Class NotificationImpl

java.lang.Object
org.eclipse.emf.common.notify.impl.NotificationImpl
All Implemented Interfaces:
Notification, NotificationChain

public class NotificationImpl extends Object implements Notification, NotificationChain
An extensible notification implementation.
  • Field Details

  • Constructor Details

    • NotificationImpl

      public NotificationImpl(int eventType, Object oldValue, Object newValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldValue - the old value before the change.
      newValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, Object oldValue, Object newValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldValue - the old value before the change.
      newValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, Object oldValue, Object newValue, int position)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldValue - the old value before the change.
      newValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, Object oldValue, Object newValue, int position, boolean wasSet)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldValue - the old value before the change.
      newValue - the new value after the change.
      wasSet - whether the feature was set before the change.
    • NotificationImpl

      public NotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldBooleanValue - the old value before the change.
      newBooleanValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldBooleanValue - the old value before the change.
      newBooleanValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, byte oldByteValue, byte newByteValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldByteValue - the old value before the change.
      newByteValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, byte oldByteValue, byte newByteValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldByteValue - the old value before the change.
      newByteValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, char oldCharValue, char newCharValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldCharValue - the old value before the change.
      newCharValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, char oldCharValue, char newCharValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldCharValue - the old value before the change.
      newCharValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldDoubleValue - the old value before the change.
      newDoubleValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldDoubleValue - the old value before the change.
      newDoubleValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, float oldFloatValue, float newFloatValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldFloatValue - the old value before the change.
      newFloatValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, float oldFloatValue, float newFloatValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldFloatValue - the old value before the change.
      newFloatValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, int oldIntValue, int newIntValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldIntValue - the old value before the change.
      newIntValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, int oldIntValue, int newIntValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldIntValue - the old value before the change.
      newIntValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, long oldLongValue, long newLongValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldLongValue - the old value before the change.
      newLongValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, long oldLongValue, long newLongValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldLongValue - the old value before the change.
      newLongValue - the new value after the change.
    • NotificationImpl

      public NotificationImpl(int eventType, short oldShortValue, short newShortValue, boolean isSetChange)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldShortValue - the old value before the change.
      newShortValue - the new value after the change.
      isSetChange - the indication of whether the state has changed.
    • NotificationImpl

      public NotificationImpl(int eventType, short oldShortValue, short newShortValue)
      Creates an instance.
      Parameters:
      eventType - the type of the change.
      oldShortValue - the old value before the change.
      newShortValue - the new value after the change.
  • Method Details

    • getNotifier

      public Object getNotifier()
      Description copied from interface: Notification
      Returns the object affected by the change.
      Specified by:
      getNotifier in interface Notification
      Returns:
      the object affected by the change.
    • getEventType

      public int getEventType()
      Description copied from interface: Notification
      Returns the type of change that has occurred. The valid types of events are defined by the constants in this class.
      Specified by:
      getEventType in interface Notification
      Returns:
      the type of change that has occurred.
      See Also:
    • getFeature

      public Object getFeature()
      Description copied from interface: Notification
      Returns the object representing the feature of the notifier that has changed.
      Specified by:
      getFeature in interface Notification
      Returns:
      the feature that has changed.
    • getFeatureID

      public int getFeatureID(Class<?> expectedClass)
      Description copied from interface: Notification
      Returns the numeric ID of the feature relative to the given class, or Notification.NO_FEATURE_ID when not applicable.
      Specified by:
      getFeatureID in interface Notification
      Parameters:
      expectedClass - the class to which the ID is relative.
      Returns:
      the numeric ID of the feature.
      See Also:
    • getOldValue

      public Object getOldValue()
      Description copied from interface: Notification
      Returns the value of the notifier's feature before the change occurred. For a list-based feature, this represents a value, or a list of values, removed from the list. For a move, this represents the old position of the moved value.
      Specified by:
      getOldValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewValue

      public Object getNewValue()
      Description copied from interface: Notification
      Returns the value of the notifier's feature after the change occurred. For a list-based feature, this represents a value, or a list of values, added to the list, an array of int containing the original index of each value in the list of values removed from the list (except for the case of a clear), the value moved within the list, or null otherwise.
      Specified by:
      getNewValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • isTouch

      public boolean isTouch()
      Description copied from interface: Notification
      Returns true if this notification represents an event that did not change the state of the notifying object. For the events Notification.ADD, Notification.ADD_MANY, Notification.REMOVE, Notification.REMOVE_MANY, Notification.MOVE, it always returns false. For the events Notification.RESOLVE and Notification.REMOVING_ADAPTER it always returns true. For the events Notification.SET and Notification.UNSET it returns true if the old and the new value are equal; In addition, for certain types of features there may be a distinction between being set to a default value and not being set at all, which implies that it has the default value. In this situation, even in the case that the old and new values are equal, isTouch may never the less return false in order to indicate that, although the value has not changed, the feature has gone from simply having a default value to being set to that same default value, or has gone from being set to the default value back to being unset.
      Specified by:
      isTouch in interface Notification
      Returns:
      whether or not this is a state changing modification.
    • isReset

      public boolean isReset()
      Description copied from interface: Notification
      Returns true if the notification's feature has been set to its default value.
      Specified by:
      isReset in interface Notification
      Returns:
      whether or not this is a feature reset event.
    • wasSet

      public boolean wasSet()
      Description copied from interface: Notification
      Returns whether the notifier's feature was considered set before the change occurred.
      Specified by:
      wasSet in interface Notification
      Returns:
      whether the notifier's feature was considered set before the change occurred.
    • isFeatureUnsettable

      protected boolean isFeatureUnsettable()
    • getFeatureDefaultValue

      protected Object getFeatureDefaultValue()
    • getPosition

      public int getPosition()
      Description copied from interface: Notification
      Returns the position within a list-based feature at which the change occurred. It returns Notification.NO_INDEX when not applicable.
      Specified by:
      getPosition in interface Notification
      Returns:
      the position at which the change occurred.
    • merge

      public boolean merge(Notification notification)
      Description copied from interface: Notification
      Returns whether the notification can be and has been merged with this one.
      Specified by:
      merge in interface Notification
      Returns:
      whether the notification can be and has been merged with this one.
    • getOldBooleanValue

      public boolean getOldBooleanValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type boolean.
      Specified by:
      getOldBooleanValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewBooleanValue

      public boolean getNewBooleanValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type boolean.
      Specified by:
      getNewBooleanValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldByteValue

      public byte getOldByteValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type byte.
      Specified by:
      getOldByteValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewByteValue

      public byte getNewByteValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type byte.
      Specified by:
      getNewByteValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldCharValue

      public char getOldCharValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type char.
      Specified by:
      getOldCharValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewCharValue

      public char getNewCharValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type char.
      Specified by:
      getNewCharValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldDoubleValue

      public double getOldDoubleValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type double.
      Specified by:
      getOldDoubleValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewDoubleValue

      public double getNewDoubleValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type double.
      Specified by:
      getNewDoubleValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldFloatValue

      public float getOldFloatValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type float.
      Specified by:
      getOldFloatValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewFloatValue

      public float getNewFloatValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type float.
      Specified by:
      getNewFloatValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldIntValue

      public int getOldIntValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type int.
      Specified by:
      getOldIntValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewIntValue

      public int getNewIntValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type int.
      Specified by:
      getNewIntValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldLongValue

      public long getOldLongValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type long.
      Specified by:
      getOldLongValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewLongValue

      public long getNewLongValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type long.
      Specified by:
      getNewLongValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldShortValue

      public short getOldShortValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature, if it is of type short.
      Specified by:
      getOldShortValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewShortValue

      public short getNewShortValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature, if it is of type short.
      Specified by:
      getNewShortValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • getOldStringValue

      public String getOldStringValue()
      Description copied from interface: Notification
      Returns the old value of the notifier's feature as a String.
      Specified by:
      getOldStringValue in interface Notification
      Returns:
      the old value of the notifier's feature.
    • getNewStringValue

      public String getNewStringValue()
      Description copied from interface: Notification
      Returns the new value of the notifier's feature as a String.
      Specified by:
      getNewStringValue in interface Notification
      Returns:
      the new value of the notifier's feature.
    • add

      public boolean add(Notification newNotification)
      Adds or merges a new notification.
      Specified by:
      add in interface NotificationChain
      Parameters:
      newNotification - a notification.
      Returns:
      true when the notification is added and false when it is merged.
    • dispatch

      public void dispatch()
      Description copied from interface: NotificationChain
      Dispatches each notification to the appropriate notifier via Notifier.eNotify.
      Specified by:
      dispatch in interface NotificationChain
    • toString

      public String toString()
      Overrides:
      toString in class Object