Most visited

Recently visited

ObservableArrayMap

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>


Summary

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

From class android.support.v4.util.ArrayMap
From class android.support.v4.util.SimpleArrayMap
From class java.lang.Object
From interface java.util.Map
From interface android.databinding.ObservableMap

Public constructors

ObservableArrayMap

ObservableArrayMap ()

Public methods

addOnMapChangedCallback

void addOnMapChangedCallback (OnMapChangedCallback<? extends ObservableMap<K, V>, K, V> listener)

添加回调以侦听对ObservableMap的更改。

Parameters
listener OnMapChangedCallback: The callback to start listening for events.

clear

void clear ()

使数组映射为空。 所有存储都被释放。

put

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.

removeAll

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.

removeAt

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.

removeOnMapChangedCallback

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.

retainAll

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.

setValueAt

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.

Hooray!