public class ObservableArrayMap<K,V> extends ArrayMap<K,V> implements ObservableMap<K,V>
ObservableMap.OnMapChangedCallback<T extends ObservableMap<K,V>,K,V>
Constructor and Description |
---|
ObservableArrayMap() |
Modifier and Type | Method and Description |
---|---|
void |
addOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> listener)
Adds a callback to listen for changes to the ObservableMap.
|
void |
clear()
Make the array map empty.
|
V |
put(K k,
V v)
Add a new value to the array map.
|
boolean |
removeAll(Collection<?> collection)
Remove all keys in the array map that exist in the given collection.
|
V |
removeAt(int index)
Remove the key/value mapping at the given index.
|
void |
removeOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> listener)
Removes a previously added callback.
|
boolean |
retainAll(Collection<?> collection)
Remove all keys in the array map that do not exist in the given collection.
|
V |
setValueAt(int index,
V value)
Set the value at a given index in the array.
|
containsAll, entrySet, keySet, putAll, values
containsKey, containsValue, ensureCapacity, equals, get, hashCode, indexOfKey, isEmpty, keyAt, putAll, remove, size, toString, valueAt
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public void addOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> listener)
ObservableMap
addOnMapChangedCallback
in interface ObservableMap<K,V>
listener
- The callback to start listening for events.public void removeOnMapChangedCallback(ObservableMap.OnMapChangedCallback<? extends ObservableMap<K,V>,K,V> listener)
ObservableMap
removeOnMapChangedCallback
in interface ObservableMap<K,V>
listener
- The callback that no longer needs to be notified of map changes.public void clear()
SimpleArrayMap
public V put(K k, V v)
SimpleArrayMap
put
in interface Map<K,V>
put
in class SimpleArrayMap<K,V>
k
- The key under which to store the value. Must not be null. If
this key already exists in the array, its value will be replaced.v
- The value to store for the given key.public boolean removeAll(Collection<?> collection)
ArrayMap
public boolean retainAll(Collection<?> collection)
ArrayMap
public V removeAt(int index)
SimpleArrayMap
removeAt
in class SimpleArrayMap<K,V>
index
- The desired index, must be between 0 and SimpleArrayMap.size()
-1.public V setValueAt(int index, V value)
SimpleArrayMap
setValueAt
in class SimpleArrayMap<K,V>
index
- The desired index, must be between 0 and SimpleArrayMap.size()
-1.value
- The new value to store at this index.