public class ObservableArrayMap
extends ArrayMap<K, V> implements ObservableMap<K, V>
| java.lang.Object | |||
| android.support.v4.util.SimpleArrayMap<K, V> | |||
| android.support.v4.util.ArrayMap<K, V> | |||
| android.databinding.ObservableArrayMap<K, V> | |||
Public constructors |
|
|---|---|
ObservableArrayMap() |
|
公共方法(Public methods) |
|
|---|---|
void |
addOnMapChangedCallback(OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener) 添加回调以侦听对ObservableMap的更改。 |
void |
clear() 使数组映射为空。 |
V |
put(K k, V v) 给数组映射添加一个新值。 |
boolean |
removeAll(Collection<?> collection) 删除给定集合中存在的数组映射中的所有键。 |
V |
removeAt(int index) 删除给定索引处的键/值映射。 |
void |
removeOnMapChangedCallback(OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener) 删除以前添加的回调。 |
boolean |
retainAll(Collection<?> collection) 删除数组映射中 不存在于给定集合中的所有键。 |
V |
setValueAt(int index, V value) 将值设置为数组中的给定索引。 |
继承方法(Inherited methods) |
|
|---|---|
android.support.v4.util.ArrayMap
|
|
android.support.v4.util.SimpleArrayMap
|
|
java.lang.Object
|
|
java.util.Map
|
|
android.databinding.ObservableMap
|
|
ObservableArrayMap ()
void addOnMapChangedCallback (OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener)
添加回调以侦听对ObservableMap的更改。
| 参数(Parameters) | |
|---|---|
listener |
OnMapChangedCallback: The callback to start listening for events. |
void clear ()
使数组映射为空。 所有存储都被释放。
V put (K k,
V v)
给数组映射添加一个新值。
| 参数(Parameters) | |
|---|---|
k |
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 |
V: The value to store for the given key. |
| 返回(Returns) | |
|---|---|
V |
Returns the old value that was stored for the given key, or null if there was no such key. |
boolean removeAll (Collection<?> collection)
删除给定集合中存在的数组映射中的所有键。
| 参数(Parameters) | |
|---|---|
collection |
Collection: The collection whose contents are to be used to remove keys. |
| 返回(Returns) | |
|---|---|
boolean |
Returns true if any keys were removed from the array map, else false. |
V removeAt (int index)
删除给定索引处的键/值映射。
| 参数(Parameters) | |
|---|---|
index |
int: The desired index, must be between 0 and size()-1. |
| 返回(Returns) | |
|---|---|
V |
Returns the value that was stored at this index. |
void removeOnMapChangedCallback (OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener)
删除以前添加的回调。
| 参数(Parameters) | |
|---|---|
listener |
OnMapChangedCallback: The callback that no longer needs to be notified of map changes. |
boolean retainAll (Collection<?> collection)
删除数组映射中 不存在于给定集合中的所有键。
| 参数(Parameters) | |
|---|---|
collection |
Collection: The collection whose contents are to be used to determine which keys to keep. |
| 返回(Returns) | |
|---|---|
boolean |
Returns true if any keys were removed from the array map, else false. |
V setValueAt (int index,
V value)
将值设置为数组中的给定索引。
| 参数(Parameters) | |
|---|---|
index |
int: The desired index, must be between 0 and size()-1. |
value |
V: The new value to store at this index. |
| 返回(Returns) | |
|---|---|
V |
Returns the previous value at the given index. |