MapChangeAdapter

class MapChangeAdapter<K, D>

An adapter that implements the reactive change model for maps

Parameters

K

the type used for the keys

D

the type used for the data

Constructors

MapChangeAdapter
Link copied to clipboard
fun <K, D> MapChangeAdapter(initialDataMap: Map<K, D>)
Initializes the adapter with initialDataMap without emitting a change message
MapChangeAdapter
Link copied to clipboard
fun MapChangeAdapter()
Default constructor

Functions

add
Link copied to clipboard
fun add(key: K, data: D): Boolean
Adds the key-value pair entry (key, data) to the map and emits a change message to surrounding observersThe change snapshot will contain the entry that was just added
addAll
Link copied to clipboard
fun addAll(dataMap: Map<K, D>): Boolean
Adds the key-value pair entries from dataMap to the map and emits a change message to surrounding observersThe change snapshot will contain a copy of the entries that were just added
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
get
Link copied to clipboard
operator fun get(key: K): D?
Retrieves the data of entry specified by key from the map
getAll
Link copied to clipboard
fun getAll(): Map<K, D>
Retrieves a snapshot of the current map
getObservable
Link copied to clipboard
fun getObservable(): Observable<ChangeMessageMap<K, D>>
Retrieves a reference to the observable used for listening to change messages
hashCode
Link copied to clipboard
open fun hashCode(): Int
remove
Link copied to clipboard
fun remove(key: K): Boolean
Removes the entry specified by key and emits a change message to surrounding observersThe change snapshot will contain the entry that was just removed
removeAll
Link copied to clipboard
fun removeAll(keySet: Set<K>): Boolean
Removes the entries specified by keySet from the map and emits a change message to surrounding observersThe change snapshot will contain a copy of the entries that were just removed
toString
Link copied to clipboard
open fun toString(): String
update
Link copied to clipboard
fun update(key: K, data: D): Boolean
Updates the entry specified by key with data in the map and emits a change message to surrounding observersThe change snapshot will contain the entry that was just updated
updateAll
Link copied to clipboard
fun updateAll(dataMap: Map<K, D>): Boolean
Updates the entries specified by dataMap in the map and emits a change message to surrounding observersThe change snapshot will contain a copy of the entries that were just updated