public class ObservableMap extends AbstractObservable 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.
| Modifier and Type | Field and Description |
|---|---|
protected Map |
wrappedMap |
| Constructor and Description |
|---|
ObservableMap(Map wrappedMap) |
ObservableMap(Realm realm,
Map wrappedMap) |
| Modifier and Type | Method and Description |
|---|---|
void |
addMapChangeListener(IMapChangeListener listener) |
void |
clear() |
boolean |
containsKey(Object key) |
boolean |
containsValue(Object value) |
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.
|
Set |
entrySet() |
boolean |
equals(Object o) |
protected void |
fireMapChange(MapDiff diff) |
Object |
get(Object key) |
Object |
getKeyType()
Returns the element type for the
keyset of this
observable map, or null if the keyset is untyped. |
protected void |
getterCalled() |
Object |
getValueType()
Returns the element type for the
values of this
observable map, or null if the values collection is untyped. |
int |
hashCode() |
boolean |
isEmpty() |
boolean |
isStale()
Returns the stale state.
|
Set |
keySet() |
Object |
put(Object key,
Object value) |
void |
putAll(Map arg0) |
Object |
remove(Object key) |
void |
removeMapChangeListener(IMapChangeListener listener) |
void |
setStale(boolean stale)
Sets the stale state.
|
int |
size() |
Collection |
values() |
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireChange, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListeneraddListener, clone, fireEvent, firstListenerAdded, getRealm, hasListeners, lastListenerRemoved, removeListenerfinalize, getClass, notify, notifyAll, toString, wait, wait, waitaddChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerprotected Map wrappedMap
public ObservableMap(Map wrappedMap)
wrappedMap - public ObservableMap(Realm realm, Map wrappedMap)
realm - wrappedMap - public void addMapChangeListener(IMapChangeListener listener)
addMapChangeListener in interface IObservableMappublic void removeMapChangeListener(IMapChangeListener listener)
removeMapChangeListener in interface IObservableMappublic 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.protected void getterCalled()
protected void fireMapChange(MapDiff diff)
public boolean containsKey(Object key)
containsKey in interface MapcontainsKey in interface IObservableMappublic boolean containsValue(Object value)
containsValue in interface MapcontainsValue in interface IObservableMappublic Set entrySet()
entrySet in interface MapentrySet in interface IObservableMappublic Object get(Object key)
get in interface Mapget in interface IObservableMappublic boolean isEmpty()
isEmpty in interface MapisEmpty in interface IObservableMappublic Set keySet()
keySet in interface MapkeySet in interface IObservableMappublic int size()
size in interface Mapsize in interface IObservableMappublic Collection values()
values in interface Mapvalues in interface IObservableMappublic boolean isStale()
isStale in interface IObservablepublic void setStale(boolean stale)
stale - The stale state to set. This will fire a stale event if the
given boolean is true and this observable set was not already
stale.public Object put(Object key, Object value)
put in interface Mapput in interface IObservableMappublic Object remove(Object key)
remove in interface Mapremove in interface IObservableMappublic int hashCode()
public void dispose()
IObservabledispose in interface IObservabledispose in class AbstractObservable