public final class ElementChangeListenerList
extends java.lang.Object
The implementation is optimized for minimal memory footprint, frequent reads and infrequent writes. Modification of the list is synchronized and relatively expensive, while accessing the listeners is very fast. Readers are given access to the underlying array data structure for reading, with the trust that they will not modify the underlying array.
Modifier and Type | Class and Description |
---|---|
static class |
ElementChangeListenerList.Entry
An entry of the element change listener list.
|
Constructor and Description |
---|
ElementChangeListenerList() |
Modifier and Type | Method and Description |
---|---|
void |
add(IElementChangeListener listener,
int eventMask)
Adds the given element change listener for the specified event types
to this list.
|
void |
clear()
Removes all listeners from this list.
|
ElementChangeListenerList.Entry[] |
getEntries()
Returns the entries of this listener list.
|
boolean |
isEmpty()
Returns whether this listener list is empty.
|
void |
remove(IElementChangeListener listener)
Removes the given element change listener from this list.
|
public void add(IElementChangeListener listener, int eventMask)
After successful completion of this method, the given listener will be registered for exactly the specified event types. If it was previously registered for other event types, it will be de-registered for those event types.
listener
- the listener to add (not null
)eventMask
- the bit-wise OR of all event types of interest to the
listenerremove(IElementChangeListener)
public void remove(IElementChangeListener listener)
listener
- the listener to remove (not null
)add(IElementChangeListener, int)
public ElementChangeListenerList.Entry[] getEntries()
adds
or removes
. Use this method when
notifying listeners, so that any modifications to the listener list
during the notification will have no effect on the notification itself.null
).
Clients must not modify the returned array.public boolean isEmpty()
true
if there are no registered listeners, and
false
otherwisepublic void clear()
Copyright (c) 2014, 2019 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0