Class NotificationImpl
java.lang.Object
org.eclipse.emf.common.notify.impl.NotificationImpl
- All Implemented Interfaces:
Notification,NotificationChain
An extensible notification implementation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe type of the change.protected static final intprotected doubleThe old value for the case ofPRIMITIVE_TYPE_DOUBLE, andPRIMITIVE_TYPE_FLOAT.protected longThe new value for the case ofPRIMITIVE_TYPE_BOOLEAN,PRIMITIVE_TYPE_BYTE,PRIMITIVE_TYPE_CHAR,PRIMITIVE_TYPE_INT,PRIMITIVE_TYPE_LONG, andPRIMITIVE_TYPE_SHORT.protected ObjectThe new value for the case ofPRIMITIVE_TYPE_OBJECT.protected NotificationChainThe internal chain.protected doubleThe old value for the case ofPRIMITIVE_TYPE_DOUBLE, andPRIMITIVE_TYPE_FLOAT.protected longThe old value for the case ofPRIMITIVE_TYPE_BOOLEAN,PRIMITIVE_TYPE_BYTE,PRIMITIVE_TYPE_CHAR,PRIMITIVE_TYPE_INT,PRIMITIVE_TYPE_LONG, andPRIMITIVE_TYPE_SHORT.protected ObjectThe old value for the case ofPRIMITIVE_TYPE_OBJECT.protected intThe position.static final intAnindicatorthat the feature is aboolean.static final intAnindicatorthat the feature is abyte.static final intAnindicatorthat the feature is achar.static final intAnindicatorthat the feature is adouble.static final intAnindicatorthat the feature is afloat.static final intAnindicatorthat the feature is aint.static final intAnindicatorthat the feature is along.static final intAnindicatorthat the feature is not a primitive type.static final intAnindicatorthat the feature is ashort.protected intThe type of the feature.Fields inherited from interface org.eclipse.emf.common.notify.Notification
ADD, ADD_MANY, CREATE, EVENT_TYPE_COUNT, MOVE, NO_FEATURE_ID, NO_INDEX, REMOVE, REMOVE_MANY, REMOVING_ADAPTER, RESOLVE, SET, UNSET -
Constructor Summary
ConstructorsConstructorDescriptionNotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue) Creates an instance.NotificationImpl(int eventType, boolean oldBooleanValue, boolean newBooleanValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, byte oldByteValue, byte newByteValue) Creates an instance.NotificationImpl(int eventType, byte oldByteValue, byte newByteValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, char oldCharValue, char newCharValue) Creates an instance.NotificationImpl(int eventType, char oldCharValue, char newCharValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue) Creates an instance.NotificationImpl(int eventType, double oldDoubleValue, double newDoubleValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, float oldFloatValue, float newFloatValue) Creates an instance.NotificationImpl(int eventType, float oldFloatValue, float newFloatValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, int oldIntValue, int newIntValue) Creates an instance.NotificationImpl(int eventType, int oldIntValue, int newIntValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, long oldLongValue, long newLongValue) Creates an instance.NotificationImpl(int eventType, long oldLongValue, long newLongValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, short oldShortValue, short newShortValue) Creates an instance.NotificationImpl(int eventType, short oldShortValue, short newShortValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, Object oldValue, Object newValue) Creates an instance.NotificationImpl(int eventType, Object oldValue, Object newValue, boolean isSetChange) Creates an instance.NotificationImpl(int eventType, Object oldValue, Object newValue, int position) Creates an instance.NotificationImpl(int eventType, Object oldValue, Object newValue, int position, boolean wasSet) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(Notification newNotification) Adds or merges a new notification.voiddispatch()Dispatches each notification to the appropriate notifier viaNotifier.eNotify.intReturns the type of change that has occurred.Returns the object representing the feature of the notifier that has changed.protected ObjectintgetFeatureID(Class<?> expectedClass) Returns the numeric ID of the feature relative to the given class, orNotification.NO_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.protected booleanbooleanisReset()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.toString()booleanwasSet()Returns whether the notifier's feature was considered set before the change occurred.
-
Field Details
-
PRIMITIVE_TYPE_OBJECT
public static final int PRIMITIVE_TYPE_OBJECTAnindicatorthat the feature is not a primitive type.- See Also:
-
PRIMITIVE_TYPE_BOOLEAN
public static final int PRIMITIVE_TYPE_BOOLEANAnindicatorthat the feature is aboolean.- See Also:
-
PRIMITIVE_TYPE_BYTE
public static final int PRIMITIVE_TYPE_BYTEAnindicatorthat the feature is abyte.- See Also:
-
PRIMITIVE_TYPE_CHAR
public static final int PRIMITIVE_TYPE_CHARAnindicatorthat the feature is achar.- See Also:
-
PRIMITIVE_TYPE_DOUBLE
public static final int PRIMITIVE_TYPE_DOUBLEAnindicatorthat the feature is adouble.- See Also:
-
PRIMITIVE_TYPE_FLOAT
public static final int PRIMITIVE_TYPE_FLOATAnindicatorthat the feature is afloat.- See Also:
-
PRIMITIVE_TYPE_INT
public static final int PRIMITIVE_TYPE_INTAnindicatorthat the feature is aint.- See Also:
-
PRIMITIVE_TYPE_LONG
public static final int PRIMITIVE_TYPE_LONGAnindicatorthat the feature is along.- See Also:
-
PRIMITIVE_TYPE_SHORT
public static final int PRIMITIVE_TYPE_SHORTAnindicatorthat the feature is ashort.- See Also:
-
IS_SET_CHANGE_INDEX
protected static final int IS_SET_CHANGE_INDEX- See Also:
-
primitiveType
protected int primitiveTypeThe type of the feature. -
eventType
protected int eventTypeThe type of the change.- See Also:
-
oldValue
The old value for the case ofPRIMITIVE_TYPE_OBJECT.- See Also:
-
newValue
The new value for the case ofPRIMITIVE_TYPE_OBJECT.- See Also:
-
oldSimplePrimitiveValue
protected long oldSimplePrimitiveValueThe old value for the case ofPRIMITIVE_TYPE_BOOLEAN,PRIMITIVE_TYPE_BYTE,PRIMITIVE_TYPE_CHAR,PRIMITIVE_TYPE_INT,PRIMITIVE_TYPE_LONG, andPRIMITIVE_TYPE_SHORT. -
newSimplePrimitiveValue
protected long newSimplePrimitiveValueThe new value for the case ofPRIMITIVE_TYPE_BOOLEAN,PRIMITIVE_TYPE_BYTE,PRIMITIVE_TYPE_CHAR,PRIMITIVE_TYPE_INT,PRIMITIVE_TYPE_LONG, andPRIMITIVE_TYPE_SHORT. -
oldIEEEPrimitiveValue
protected double oldIEEEPrimitiveValueThe old value for the case ofPRIMITIVE_TYPE_DOUBLE, andPRIMITIVE_TYPE_FLOAT. -
newIEEEPrimitiveValue
protected double newIEEEPrimitiveValueThe old value for the case ofPRIMITIVE_TYPE_DOUBLE, andPRIMITIVE_TYPE_FLOAT. -
position
protected int positionThe position.- See Also:
-
next
The internal chain.
-
-
Constructor Details
-
NotificationImpl
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
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
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
Description copied from interface:NotificationReturns the object affected by the change.- Specified by:
getNotifierin interfaceNotification- Returns:
- the object affected by the change.
-
getEventType
public int getEventType()Description copied from interface:NotificationReturns the type of change that has occurred. The valid types of events are defined by the constants in this class.- Specified by:
getEventTypein interfaceNotification- Returns:
- the type of change that has occurred.
- See Also:
-
getFeature
Description copied from interface:NotificationReturns the object representing the feature of the notifier that has changed.- Specified by:
getFeaturein interfaceNotification- Returns:
- the feature that has changed.
-
getFeatureID
Description copied from interface:NotificationReturns the numeric ID of the feature relative to the given class, orNotification.NO_FEATURE_IDwhen not applicable.- Specified by:
getFeatureIDin interfaceNotification- Parameters:
expectedClass- the class to which the ID is relative.- Returns:
- the numeric ID of the feature.
- See Also:
-
getOldValue
Description copied from interface:NotificationReturns 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:
getOldValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewValue
Description copied from interface:NotificationReturns 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.- Specified by:
getNewValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
isTouch
public boolean isTouch()Description copied from interface:NotificationReturns true if this notification represents an event that did not change the state of the notifying object. For the eventsNotification.ADD,Notification.ADD_MANY,Notification.REMOVE,Notification.REMOVE_MANY,Notification.MOVE, it always returns false. For the eventsNotification.RESOLVEandNotification.REMOVING_ADAPTERit always returns true. For the eventsNotification.SETandNotification.UNSETit 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:
isTouchin interfaceNotification- Returns:
- whether or not this is a state changing modification.
-
isReset
public boolean isReset()Description copied from interface:NotificationReturns true if the notification's feature has been set to its default value.- Specified by:
isResetin interfaceNotification- Returns:
- whether or not this is a feature reset event.
-
wasSet
public boolean wasSet()Description copied from interface:NotificationReturns whether the notifier's feature was considered set before the change occurred.- Specified by:
wasSetin interfaceNotification- Returns:
- whether the notifier's feature was considered set before the change occurred.
-
isFeatureUnsettable
protected boolean isFeatureUnsettable() -
getFeatureDefaultValue
-
getPosition
public int getPosition()Description copied from interface:NotificationReturns the position within a list-based feature at which the change occurred. It returnsNotification.NO_INDEXwhen not applicable.- Specified by:
getPositionin interfaceNotification- Returns:
- the position at which the change occurred.
-
merge
Description copied from interface:NotificationReturns whether the notification can be and has been merged with this one.- Specified by:
mergein interfaceNotification- Returns:
- whether the notification can be and has been merged with this one.
-
getOldBooleanValue
public boolean getOldBooleanValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typeboolean.- Specified by:
getOldBooleanValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewBooleanValue
public boolean getNewBooleanValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typeboolean.- Specified by:
getNewBooleanValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldByteValue
public byte getOldByteValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typebyte.- Specified by:
getOldByteValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewByteValue
public byte getNewByteValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typebyte.- Specified by:
getNewByteValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldCharValue
public char getOldCharValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typechar.- Specified by:
getOldCharValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewCharValue
public char getNewCharValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typechar.- Specified by:
getNewCharValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldDoubleValue
public double getOldDoubleValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typedouble.- Specified by:
getOldDoubleValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewDoubleValue
public double getNewDoubleValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typedouble.- Specified by:
getNewDoubleValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldFloatValue
public float getOldFloatValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typefloat.- Specified by:
getOldFloatValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewFloatValue
public float getNewFloatValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typefloat.- Specified by:
getNewFloatValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldIntValue
public int getOldIntValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typeint.- Specified by:
getOldIntValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewIntValue
public int getNewIntValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typeint.- Specified by:
getNewIntValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldLongValue
public long getOldLongValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typelong.- Specified by:
getOldLongValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewLongValue
public long getNewLongValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typelong.- Specified by:
getNewLongValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldShortValue
public short getOldShortValue()Description copied from interface:NotificationReturns the old value of the notifier's feature, if it is of typeshort.- Specified by:
getOldShortValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewShortValue
public short getNewShortValue()Description copied from interface:NotificationReturns the new value of the notifier's feature, if it is of typeshort.- Specified by:
getNewShortValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
getOldStringValue
Description copied from interface:NotificationReturns the old value of the notifier's feature as a String.- Specified by:
getOldStringValuein interfaceNotification- Returns:
- the old value of the notifier's feature.
-
getNewStringValue
Description copied from interface:NotificationReturns the new value of the notifier's feature as a String.- Specified by:
getNewStringValuein interfaceNotification- Returns:
- the new value of the notifier's feature.
-
add
Adds or merges a new notification.- Specified by:
addin interfaceNotificationChain- Parameters:
newNotification- a notification.- Returns:
truewhen the notification is added andfalsewhen it is merged.
-
dispatch
public void dispatch()Description copied from interface:NotificationChainDispatches each notification to the appropriate notifier viaNotifier.eNotify.- Specified by:
dispatchin interfaceNotificationChain
-
toString
-