public interface Notification
Modifier and Type | Field and Description |
---|---|
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. |
Modifier and Type | Method and Description |
---|---|
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.
|
@Deprecated static final int CREATE
event type
indicating that
the notifier has been created.getEventType()
,
Constant Field Valuesstatic final int SET
event type
indicating that
a feature of the notifier has been set.
This applies for simple features.getEventType()
,
Constant Field Valuesstatic final int UNSET
event type
indicating that
a feature of the notifier has been unset.
This applies for unsettable features.getEventType()
,
Constant Field Valuesstatic final int ADD
event type
indicating that
a value has been inserted into a list-based feature of the notifier.getEventType()
,
Constant Field Valuesstatic final int REMOVE
event type
indicating that
a value has been removed from a list-based feature of the notifier.getEventType()
,
Constant Field Valuesstatic final int ADD_MANY
event type
indicating that
a several values have been added into a list-based feature of the notifier.getEventType()
,
Constant Field Valuesstatic final int REMOVE_MANY
event type
indicating that
a several values have been removed from a list-based feature of the notifier.getEventType()
,
Constant Field Valuesstatic final int MOVE
event type
indicating that
a value has been moved within a list-based feature of the notifier.getEventType()
,
Constant Field Valuesstatic final int REMOVING_ADAPTER
event type
indicating that
an adapter is being removed from the notifier.getEventType()
,
Constant Field Valuesstatic final int RESOLVE
event type
indicating that
a feature of the notifier has been resolved from a proxy.getEventType()
,
Constant Field Valuesstatic final int EVENT_TYPE_COUNT
event types
.
User defined event types should start from this value.
Clients are expected to ignore types they don't recognize.getEventType()
,
Constant Field Valuesstatic final int NO_FEATURE_ID
ID
indicating that
no feature ID information is applicable.static final int NO_INDEX
index
indicating that
no position information is applicable.getPosition()
,
Constant Field Valuesjava.lang.Object getNotifier()
int getEventType()
Notifier
int getFeatureID(java.lang.Class<?> expectedClass)
NO_FEATURE_ID
when not applicable.expectedClass
- the class to which the ID is relative.NO_FEATURE_ID
java.lang.Object getFeature()
java.lang.Object getOldValue()
java.lang.Object getNewValue()
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.boolean wasSet()
boolean isTouch()
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.boolean isReset()
int getPosition()
NO_INDEX
when not applicable.boolean merge(Notification notification)
boolean getOldBooleanValue()
boolean
.java.lang.IllegalStateException
- if the feature isn't boolean
.boolean getNewBooleanValue()
boolean
.java.lang.IllegalStateException
- if the feature isn't boolean
.byte getOldByteValue()
byte
.java.lang.IllegalStateException
- if the feature isn't byte
.byte getNewByteValue()
byte
.java.lang.IllegalStateException
- if the feature isn't byte
.char getOldCharValue()
char
.java.lang.IllegalStateException
- if the feature isn't char
.char getNewCharValue()
char
.java.lang.IllegalStateException
- if the feature isn't char
.double getOldDoubleValue()
double
.java.lang.IllegalStateException
- if the feature isn't double
.double getNewDoubleValue()
double
.java.lang.IllegalStateException
- if the feature isn't double
.float getOldFloatValue()
float
.java.lang.IllegalStateException
- if the feature isn't float
.float getNewFloatValue()
float
.java.lang.IllegalStateException
- if the feature isn't float
.int getOldIntValue()
int
.java.lang.IllegalStateException
- if the feature isn't int
.int getNewIntValue()
int
.java.lang.IllegalStateException
- if the feature isn't int
.long getOldLongValue()
long
.java.lang.IllegalStateException
- if the feature isn't long
.long getNewLongValue()
long
.java.lang.IllegalStateException
- if the feature isn't long
.short getOldShortValue()
short
.java.lang.IllegalStateException
- if the feature isn't short
.short getNewShortValue()
short
.java.lang.IllegalStateException
- if the feature isn't short
.java.lang.String getOldStringValue()
java.lang.String getNewStringValue()