## org.eclipse.emf.common.notify
Interface Notification

All Known Subinterfaces:
  IViewerNotification

All Known Implementing Classes:
  ENotificationImpl, FeatureMapUtil.FeatureENotificationImpl, ItemProvider.ItemProviderNotification, NotificationImpl, NotificationWrapper, ViewerNotification

    public interface Notification

A description of a feature change that has occurred for some notifier.

See Also:
  `Adapter.notifyChanged(org.eclipse.emf.common.notify.Notification)`, `Notifier`

Field Summary
`static int` `ADD` An `event type` indicating that a value has been inserted into a list-based feature of the notifier.
`static int` `ADD_MANY` An `event type` indicating that a several values have been added into a list-based feature of the notifier.
`static int` `CREATE` Deprecated.
`static int` `EVENT_TYPE_COUNT` The number of built-in `event types`.
`static int` `MOVE` An `event type` indicating that a value has been moved within a list-based feature of the notifier.
`static int` `NO_FEATURE_ID` An `ID` indicating that no feature ID information is applicable.
`static int` `NO_INDEX` An `index` indicating that no position information is applicable.
`static int` `REMOVE` An `event type` indicating that a value has been removed from a list-based feature of the notifier.
`static int` `REMOVE_MANY` An `event type` indicating that a several values have been removed from a list-based feature of the notifier.
`static int` `REMOVING_ADAPTER` An `event type` indicating that an adapter is being removed from the notifier.
`static int` `RESOLVE` An `event type` indicating that a feature of the notifier has been resolved from a proxy.
`static int` `SET` An `event type` indicating that a feature of the notifier has been set.
`static int` `UNSET` An `event type` indicating that a feature of the notifier has been unset.

Method Summary
`int` `getEventType()` Returns the type of change that has occurred.
`java.lang.Object` `getFeature()` Returns the object representing the feature of the notifier that has changed.
`int` `getFeatureID(java.lang.Class<?> expectedClass)` Returns the numeric ID of the feature relative to the given class, or `NO_FEATURE_ID` when not applicable.
`boolean` `getNewBooleanValue()` Returns the new value of the notifier's feature, if it is of type `boolean`.
`byte` `getNewByteValue()` Returns the new value of the notifier's feature, if it is of type `byte`.
`char` `getNewCharValue()` Returns the new value of the notifier's feature, if it is of type `char`.
`double` `getNewDoubleValue()` Returns the new value of the notifier's feature, if it is of type `double`.
`float` `getNewFloatValue()` Returns the new value of the notifier's feature, if it is of type `float`.
`int` `getNewIntValue()` Returns the new value of the notifier's feature, if it is of type `int`.
`long` `getNewLongValue()` Returns the new value of the notifier's feature, if it is of type `long`.
`short` `getNewShortValue()` Returns the new value of the notifier's feature, if it is of type `short`.
`java.lang.String` `getNewStringValue()` Returns the new value of the notifier's feature as a String.
`java.lang.Object` `getNewValue()` Returns the value of the notifier's feature after the change occurred.
`java.lang.Object` `getNotifier()` Returns the object affected by the change.
`boolean` `getOldBooleanValue()` Returns the old value of the notifier's feature, if it is of type `boolean`.
`byte` `getOldByteValue()` Returns the old value of the notifier's feature, if it is of type `byte`.
`char` `getOldCharValue()` Returns the old value of the notifier's feature, if it is of type `char`.
`double` `getOldDoubleValue()` Returns the old value of the notifier's feature, if it is of type `double`.
`float` `getOldFloatValue()` Returns the old value of the notifier's feature, if it is of type `float`.
`int` `getOldIntValue()` Returns the old value of the notifier's feature, if it is of type `int`.
`long` `getOldLongValue()` Returns the old value of the notifier's feature, if it is of type `long`.
`short` `getOldShortValue()` Returns the old value of the notifier's feature, if it is of type `short`.
`java.lang.String` `getOldStringValue()` Returns the old value of the notifier's feature as a String.
`java.lang.Object` `getOldValue()` Returns the value of the notifier's feature before the change occurred.
`int` `getPosition()` Returns the position within a list-based feature at which the change occurred.
`boolean` `isReset()` Returns true if the notification's feature has been set to its default value.
`boolean` `isTouch()` Returns true if this notification represents an event that did not change the state of the notifying object.
`boolean` `merge(Notification notification)` Returns whether the notification can be and has been merged with this one.
`boolean` `wasSet()` Returns whether the notifier's feature was considered set before the change occurred.

Field Detail

### CREATE

    @Deprecated
    static final int CREATE

  Deprecated.
  An `event type` indicating that the notifier has been created.

  See Also:
    `getEventType()`, Constant Field Values

### SET

    static final int SET

  An `event type` indicating that a feature of the notifier has been set. This applies for simple features.

  See Also:
    `getEventType()`, Constant Field Values

### UNSET

    static final int UNSET

  An `event type` indicating that a feature of the notifier has been unset. This applies for unsettable features.

  See Also:
    `getEventType()`, Constant Field Values

### ADD

    static final int ADD

  An `event type` indicating that a value has been inserted into a list-based feature of the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### REMOVE

    static final int REMOVE

  An `event type` indicating that a value has been removed from a list-based feature of the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### ADD_MANY

    static final int ADD_MANY

  An `event type` indicating that a several values have been added into a list-based feature of the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### REMOVE_MANY

    static final int REMOVE_MANY

  An `event type` indicating that a several values have been removed from a list-based feature of the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### MOVE

    static final int MOVE

  An `event type` indicating that a value has been moved within a list-based feature of the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### REMOVING_ADAPTER

    static final int REMOVING_ADAPTER

  An `event type` indicating that an adapter is being removed from the notifier.

  See Also:
    `getEventType()`, Constant Field Values

### RESOLVE

    static final int RESOLVE

  An `event type` indicating that a feature of the notifier has been resolved from a proxy.

  See Also:
    `getEventType()`, Constant Field Values

### EVENT_TYPE_COUNT

    static final int EVENT_TYPE_COUNT

  The number of built-in `event types`. User defined event types should start from this value. Clients are expected to ignore types they don't recognize.

  See Also:
    `getEventType()`, Constant Field Values

### NO_FEATURE_ID

    static final int NO_FEATURE_ID

  An `ID` indicating that no feature ID information is applicable.

  See Also:
    `getFeatureID(java.lang.Class<?>)`, Constant Field Values

### NO_INDEX

    static final int NO_INDEX

  An `index` indicating that no position information is applicable.

  See Also:
    `getPosition()`, Constant Field Values

Method Detail

### getNotifier

    java.lang.Object getNotifier()

  Returns the object affected by the change.

  Returns:
    the object affected by the change.

### getEventType

    int getEventType()

  Returns the type of change that has occurred. The valid types of events are defined by the constants in this class.

  Returns:
    the type of change that has occurred.
  See Also:
    `Notifier`

### getFeatureID

    int getFeatureID(java.lang.Class<?> expectedClass)

  Returns the numeric ID of the feature relative to the given class, or `NO_FEATURE_ID` when not applicable.

  Parameters:
    `expectedClass` - the class to which the ID is relative.
  Returns:
    the numeric ID of the feature.
  See Also:
    `NO_FEATURE_ID`

### getFeature

    java.lang.Object getFeature()

  Returns the object representing the feature of the notifier that has changed.

  Returns:
    the feature that has changed.

### getOldValue

    java.lang.Object getOldValue()

  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.

  Returns:
    the old value of the notifier's feature.

### getNewValue

    java.lang.Object getNewValue()

  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.

  Returns:
    the new value of the notifier's feature.

### wasSet

    boolean wasSet()

  Returns whether the notifier's feature was considered set before the change occurred.

  Returns:
    whether the notifier's feature was considered set before the change occurred.

### isTouch

    boolean isTouch()

  Returns true if this notification represents an event that did not change the state of the notifying object. For the events `ADD`, `ADD_MANY`, `REMOVE`, `REMOVE_MANY`, `MOVE`, it always returns false. For the events `RESOLVE` and `REMOVING_ADAPTER` it always returns true. For the events `SET` and `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.

  Returns:
    whether or not this is a state changing modification.

### isReset

    boolean isReset()

  Returns true if the notification's feature has been set to its default value.

  Returns:
    whether or not this is a feature reset event.

### getPosition

    int getPosition()

  Returns the position within a list-based feature at which the change occurred. It returns `NO_INDEX` when not applicable.

  Returns:
    the position at which the change occurred.

### merge

    boolean merge(Notification notification)

  Returns whether the notification can be and has been merged with this one.

  Returns:
    whether the notification can be and has been merged with this one.

### getOldBooleanValue

    boolean getOldBooleanValue()

  Returns the old value of the notifier's feature, if it is of type `boolean`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `boolean`.

### getNewBooleanValue

    boolean getNewBooleanValue()

  Returns the new value of the notifier's feature, if it is of type `boolean`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `boolean`.

### getOldByteValue

    byte getOldByteValue()

  Returns the old value of the notifier's feature, if it is of type `byte`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `byte`.

### getNewByteValue

    byte getNewByteValue()

  Returns the new value of the notifier's feature, if it is of type `byte`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `byte`.

### getOldCharValue

    char getOldCharValue()

  Returns the old value of the notifier's feature, if it is of type `char`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `char`.

### getNewCharValue

    char getNewCharValue()

  Returns the new value of the notifier's feature, if it is of type `char`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `char`.

### getOldDoubleValue

    double getOldDoubleValue()

  Returns the old value of the notifier's feature, if it is of type `double`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `double`.

### getNewDoubleValue

    double getNewDoubleValue()

  Returns the new value of the notifier's feature, if it is of type `double`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `double`.

### getOldFloatValue

    float getOldFloatValue()

  Returns the old value of the notifier's feature, if it is of type `float`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `float`.

### getNewFloatValue

    float getNewFloatValue()

  Returns the new value of the notifier's feature, if it is of type `float`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `float`.

### getOldIntValue

    int getOldIntValue()

  Returns the old value of the notifier's feature, if it is of type `int`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `int`.

### getNewIntValue

    int getNewIntValue()

  Returns the new value of the notifier's feature, if it is of type `int`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `int`.

### getOldLongValue

    long getOldLongValue()

  Returns the old value of the notifier's feature, if it is of type `long`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `long`.

### getNewLongValue

    long getNewLongValue()

  Returns the new value of the notifier's feature, if it is of type `long`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `long`.

### getOldShortValue

    short getOldShortValue()

  Returns the old value of the notifier's feature, if it is of type `short`.

  Returns:
    the old value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `short`.

### getNewShortValue

    short getNewShortValue()

  Returns the new value of the notifier's feature, if it is of type `short`.

  Returns:
    the new value of the notifier's feature.
  Throws:
    `java.lang.IllegalStateException` - if the feature isn't `short`.

### getOldStringValue

    java.lang.String getOldStringValue()

  Returns the old value of the notifier's feature as a String.

  Returns:
    the old value of the notifier's feature.

### getNewStringValue

    java.lang.String getNewStringValue()

  Returns the new value of the notifier's feature as a String.

  Returns:
    the new value of the notifier's feature.

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.