Package org.eclipse.emf.common.notify
Interface Notification
- All Known Implementing Classes:
NotificationImpl,NotificationWrapper
public interface Notification
A description of a feature change that has occurred for some notifier.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAnevent typeindicating that a value has been inserted into a list-based feature of the notifier.static final intAnevent typeindicating that a several values have been added into a list-based feature of the notifier.static final intDeprecated.static final intThe number of built-inevent types.static final intAnevent typeindicating that a value has been moved within a list-based feature of the notifier.static final intAnIDindicating that no feature ID information is applicable.static final intAnindexindicating that no position information is applicable.static final intAnevent typeindicating that a value has been removed from a list-based feature of the notifier.static final intAnevent typeindicating that a several values have been removed from a list-based feature of the notifier.static final intAnevent typeindicating that an adapter is being removed from the notifier.static final intAnevent typeindicating that a feature of the notifier has been resolved from a proxy.static final intAnevent typeindicating that a feature of the notifier has been set.static final intAnevent typeindicating that a feature of the notifier has been unset. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the type of change that has occurred.Returns the object representing the feature of the notifier that has changed.intgetFeatureID(Class<?> expectedClass) Returns the numeric ID of the feature relative to the given class, orNO_FEATURE_IDwhen not applicable.booleanReturns the new value of the notifier's feature, if it is of typeboolean.byteReturns the new value of the notifier's feature, if it is of typebyte.charReturns the new value of the notifier's feature, if it is of typechar.doubleReturns the new value of the notifier's feature, if it is of typedouble.floatReturns the new value of the notifier's feature, if it is of typefloat.intReturns the new value of the notifier's feature, if it is of typeint.longReturns the new value of the notifier's feature, if it is of typelong.shortReturns the new value of the notifier's feature, if it is of typeshort.Returns the new value of the notifier's feature as a String.Returns the value of the notifier's feature after the change occurred.Returns the object affected by the change.booleanReturns the old value of the notifier's feature, if it is of typeboolean.byteReturns the old value of the notifier's feature, if it is of typebyte.charReturns the old value of the notifier's feature, if it is of typechar.doubleReturns the old value of the notifier's feature, if it is of typedouble.floatReturns the old value of the notifier's feature, if it is of typefloat.intReturns the old value of the notifier's feature, if it is of typeint.longReturns the old value of the notifier's feature, if it is of typelong.shortReturns the old value of the notifier's feature, if it is of typeshort.Returns the old value of the notifier's feature as a String.Returns the value of the notifier's feature before the change occurred.intReturns the position within a list-based feature at which the change occurred.booleanisReset()Returns true if the notification's feature has been set to its default value.booleanisTouch()Returns true if this notification represents an event that did not change the state of the notifying object.booleanmerge(Notification notification) Returns whether the notification can be and has been merged with this one.booleanwasSet()Returns whether the notifier's feature was considered set before the change occurred.
-
Field Details
-
CREATE
Deprecated.Anevent typeindicating that the notifier has been created.- See Also:
-
SET
static final int SETAnevent typeindicating that a feature of the notifier has been set. This applies for simple features.- See Also:
-
UNSET
static final int UNSETAnevent typeindicating that a feature of the notifier has been unset. This applies for unsettable features.- See Also:
-
ADD
static final int ADDAnevent typeindicating that a value has been inserted into a list-based feature of the notifier.- See Also:
-
REMOVE
static final int REMOVEAnevent typeindicating that a value has been removed from a list-based feature of the notifier.- See Also:
-
ADD_MANY
static final int ADD_MANYAnevent typeindicating that a several values have been added into a list-based feature of the notifier.- See Also:
-
REMOVE_MANY
static final int REMOVE_MANYAnevent typeindicating that a several values have been removed from a list-based feature of the notifier.- See Also:
-
MOVE
static final int MOVEAnevent typeindicating that a value has been moved within a list-based feature of the notifier.- See Also:
-
REMOVING_ADAPTER
static final int REMOVING_ADAPTERAnevent typeindicating that an adapter is being removed from the notifier.- See Also:
-
RESOLVE
static final int RESOLVEAnevent typeindicating that a feature of the notifier has been resolved from a proxy.- See Also:
-
EVENT_TYPE_COUNT
static final int EVENT_TYPE_COUNTThe number of built-inevent types. User defined event types should start from this value. Clients are expected to ignore types they don't recognize.- See Also:
-
NO_FEATURE_ID
static final int NO_FEATURE_IDAnIDindicating that no feature ID information is applicable. -
NO_INDEX
static final int NO_INDEXAnindexindicating that no position information is applicable.- See Also:
-
-
Method Details
-
getNotifier
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:
-
getFeatureID
Returns the numeric ID of the feature relative to the given class, orNO_FEATURE_IDwhen not applicable.- Parameters:
expectedClass- the class to which the ID is relative.- Returns:
- the numeric ID of the feature.
- See Also:
-
getFeature
Object getFeature()Returns the object representing the feature of the notifier that has changed.- Returns:
- the feature that has changed.
-
getOldValue
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
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, an array ofintcontaining 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.- 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 eventsADD,ADD_MANY,REMOVE,REMOVE_MANY,MOVE, it always returns false. For the eventsRESOLVEandREMOVING_ADAPTERit always returns true. For the eventsSETandUNSETit 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 returnsNO_INDEXwhen not applicable.- Returns:
- the position at which the change occurred.
-
merge
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 typeboolean.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tboolean.
-
getNewBooleanValue
boolean getNewBooleanValue()Returns the new value of the notifier's feature, if it is of typeboolean.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tboolean.
-
getOldByteValue
byte getOldByteValue()Returns the old value of the notifier's feature, if it is of typebyte.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tbyte.
-
getNewByteValue
byte getNewByteValue()Returns the new value of the notifier's feature, if it is of typebyte.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tbyte.
-
getOldCharValue
char getOldCharValue()Returns the old value of the notifier's feature, if it is of typechar.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tchar.
-
getNewCharValue
char getNewCharValue()Returns the new value of the notifier's feature, if it is of typechar.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tchar.
-
getOldDoubleValue
double getOldDoubleValue()Returns the old value of the notifier's feature, if it is of typedouble.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tdouble.
-
getNewDoubleValue
double getNewDoubleValue()Returns the new value of the notifier's feature, if it is of typedouble.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tdouble.
-
getOldFloatValue
float getOldFloatValue()Returns the old value of the notifier's feature, if it is of typefloat.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tfloat.
-
getNewFloatValue
float getNewFloatValue()Returns the new value of the notifier's feature, if it is of typefloat.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tfloat.
-
getOldIntValue
int getOldIntValue()Returns the old value of the notifier's feature, if it is of typeint.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tint.
-
getNewIntValue
int getNewIntValue()Returns the new value of the notifier's feature, if it is of typeint.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tint.
-
getOldLongValue
long getOldLongValue()Returns the old value of the notifier's feature, if it is of typelong.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tlong.
-
getNewLongValue
long getNewLongValue()Returns the new value of the notifier's feature, if it is of typelong.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tlong.
-
getOldShortValue
short getOldShortValue()Returns the old value of the notifier's feature, if it is of typeshort.- Returns:
- the old value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tshort.
-
getNewShortValue
short getNewShortValue()Returns the new value of the notifier's feature, if it is of typeshort.- Returns:
- the new value of the notifier's feature.
- Throws:
IllegalStateException- if the feature isn'tshort.
-
getOldStringValue
String getOldStringValue()Returns the old value of the notifier's feature as a String.- Returns:
- the old value of the notifier's feature.
-
getNewStringValue
String getNewStringValue()Returns the new value of the notifier's feature as a String.- Returns:
- the new value of the notifier's feature.
-