K - the type of the keys in this mapV - the type of the values in this mappublic class WritableMap<K,V> extends ObservableMap<K,V>
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.
wrappedMap| Constructor and Description |
|---|
WritableMap()
Constructs a new WritableMap on the default realm.
|
WritableMap(java.lang.Object keyType,
java.lang.Object valueType)
Constructs a new WritableMap on the default realm with the specified key
and value types.
|
WritableMap(Realm realm)
Constructs a new WritableMap on the given realm.
|
WritableMap(Realm realm,
java.lang.Object keyType,
java.lang.Object valueType)
Constructs a new WritableMap on the given realm with the specified key
and value types.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addListener(java.lang.Object listenerType,
IObservablesListener listener) |
void |
clear()
Clears the map.
|
protected java.lang.Object |
clone() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
firstListenerAdded() |
java.lang.Object |
getKeyType()
Returns the element type for the
keyset of this
observable map, or null if the keyset is untyped. |
Realm |
getRealm() |
java.lang.Object |
getValueType()
Returns the element type for the
values of this
observable map, or null if the values collection is untyped. |
protected boolean |
hasListeners() |
protected void |
lastListenerRemoved() |
V |
put(K key,
V value)
Associates the provided
value with the key. |
void |
putAll(java.util.Map<? extends K,? extends V> map)
Adds the provided
map's contents to this map. |
V |
remove(java.lang.Object key)
Removes the value with the provide
key. |
protected void |
removeListener(java.lang.Object listenerType,
IObservablesListener listener) |
addMapChangeListener, containsKey, containsValue, dispose, entrySet, equals, fireMapChange, get, getterCalled, hashCode, isEmpty, isStale, keySet, removeMapChangeListener, setStale, size, valuesaddChangeListener, addDisposeListener, addStaleListener, checkRealm, fireChange, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerfinalize, getClass, notify, notifyAll, toString, wait, wait, waitcompute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAlladdChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerpublic WritableMap()
public WritableMap(Realm realm)
realm - the realmpublic WritableMap(java.lang.Object keyType,
java.lang.Object valueType)
keyType - valueType - public WritableMap(Realm realm, java.lang.Object keyType, java.lang.Object valueType)
realm - keyType - valueType - public java.lang.Object getKeyType()
IObservableMapkeyset of this
observable map, or null if the keyset is untyped.getKeyType in interface IObservableMap<K,V>getKeyType in class ObservableMap<K,V>keyset of this
observable map, or null if the keyset is untyped.public java.lang.Object getValueType()
IObservableMapvalues of this
observable map, or null if the values collection is untyped.getValueType in interface IObservableMap<K,V>getValueType in class ObservableMap<K,V>values of this
observable map, or null if the values collection is
untyped.public V put(K key, V value)
value with the key.
Must be invoked from the current realm.put in interface java.util.Map<K,V>put in interface IObservableMap<K,V>put in class ObservableMap<K,V>public V remove(java.lang.Object key)
key. Must be invoked from
the current realm.remove in interface java.util.Map<K,V>remove in interface IObservableMap<K,V>remove in class ObservableMap<K,V>public void clear()
public void putAll(java.util.Map<? extends K,? extends V> map)
map's contents to this map. Must be
invoked from the current realm.protected void addListener(java.lang.Object listenerType,
IObservablesListener listener)
listenerType - listener - protected void removeListener(java.lang.Object listenerType,
IObservablesListener listener)
listenerType - listener - protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
protected void firstListenerAdded()
protected void lastListenerRemoved()
public Realm getRealm()
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.