public abstract class AbstractObservableMap extends AbstractMap implements IObservableMap
This class is thread safe. All state accessing methods must be invoked from
the current realm. Methods for adding and removing
listeners may be invoked from any thread.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Constructor and Description |
|---|
AbstractObservableMap() |
AbstractObservableMap(Realm realm) |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(IChangeListener listener)
Adds the given change listener to the list of change listeners.
|
void |
addDisposeListener(IDisposeListener listener)
Adds the given dispose listener to the list of dispose listeners.
|
void |
addMapChangeListener(IMapChangeListener listener) |
void |
addStaleListener(IStaleListener listener)
Adds the given stale listener to the list of stale listeners.
|
protected void |
checkRealm()
Asserts that the realm is the current realm.
|
void |
dispose()
Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects.
|
protected void |
fireChange()
Fires change events.
|
protected void |
fireMapChange(MapDiff diff)
Fires map change events.
|
protected void |
fireStale()
Fires stale events.
|
protected void |
firstListenerAdded() |
Object |
getKeyType()
Returns the element type for the
keyset of this
observable map, or null if the keyset is untyped. |
Realm |
getRealm()
Returns the realm for this observable.
|
Object |
getValueType()
Returns the element type for the
values of this
observable map, or null if the values collection is untyped. |
protected boolean |
hasListeners() |
boolean |
isDisposed()
Returns whether the observable has been disposed
|
boolean |
isStale()
Returns whether the state of this observable is stale and is expected to
change soon.
|
protected void |
lastListenerRemoved() |
void |
removeChangeListener(IChangeListener listener)
Removes the given change listener from the list of change listeners.
|
void |
removeDisposeListener(IDisposeListener listener)
Removes the given dispose listener from the list of dispose listeners.
|
void |
removeMapChangeListener(IMapChangeListener listener) |
void |
removeStaleListener(IStaleListener listener)
Removes the given stale listener from the list of stale listeners.
|
void |
setStale(boolean stale)
Sets the stale state.
|
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, remove, size, valuespublic AbstractObservableMap()
public AbstractObservableMap(Realm realm)
realm - protected void lastListenerRemoved()
protected void firstListenerAdded()
public void addMapChangeListener(IMapChangeListener listener)
addMapChangeListener in interface IObservableMappublic void removeMapChangeListener(IMapChangeListener listener)
removeMapChangeListener in interface IObservableMappublic void addChangeListener(IChangeListener listener)
IObservableaddChangeListener in interface IObservablepublic void addStaleListener(IStaleListener listener)
IObservableaddStaleListener in interface IObservableIObservable.isStale()protected boolean hasListeners()
public void addDisposeListener(IDisposeListener listener)
IObservableaddDisposeListener in interface IObservablelistener - the listener to addpublic void removeDisposeListener(IDisposeListener listener)
IObservableremoveDisposeListener in interface IObservablelistener - the listener to removepublic boolean isDisposed()
IObservableisDisposed in interface IObservablepublic void dispose()
IObservabledispose in interface IObservablepublic Realm getRealm()
IObservableBecause observables can only be accessed from within one realm, and they always fire events on that realm, their state can be observed in an incremental way. It is always safe to call getters of an observable from within a change listener attached to that observable.
getRealm in interface IObservablepublic boolean isStale()
IObservableisStale in interface IObservablepublic Object getKeyType()
IObservableMapkeyset of this
observable map, or null if the keyset is untyped.getKeyType in interface IObservableMapkeyset of this
observable map, or null if the keyset is untyped.public Object getValueType()
IObservableMapvalues of this
observable map, or null if the values collection is untyped.getValueType in interface IObservableMapvalues of this
observable map, or null if the values collection is
untyped.public void removeChangeListener(IChangeListener listener)
IObservableremoveChangeListener in interface IObservablepublic void removeStaleListener(IStaleListener listener)
IObservableremoveStaleListener in interface IObservablepublic void setStale(boolean stale)
stale - protected void fireStale()
protected void fireChange()
protected void fireMapChange(MapDiff diff)
diff - protected void checkRealm()
AssertionFailedException - if the realm is not the current realmRealm.isCurrent()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.