ListChangeAdapter

class ListChangeAdapter<D>

An adapter that implements the reactive change model for lists

Parameters

D

the type of data held by the list

Constructors

ListChangeAdapter
Link copied to clipboard
fun <D> ListChangeAdapter(initialDataList: List<D>)
Initializes the adapter with initialDataList without emitting a change message
ListChangeAdapter
Link copied to clipboard
fun ListChangeAdapter()
Default constructor

Functions

add
Link copied to clipboard
fun add(data: D): Boolean
Adds data to the list and emits a change message to surrounding observersThe change snapshot will contain data that was just added
addAll
Link copied to clipboard
fun addAll(dataList: List<D>): Boolean
Adds dataList to the list and emits a change message to surrounding observersThe change snapshot will contain a copy of dataList that was just added
addAt
Link copied to clipboard
fun addAt(index: Int, data: D): Boolean
Adds data to the list at the specified index and emits a change message to surrounding observersThe change snapshot will contain data that was just added
equals
Link copied to clipboard
open operator fun equals(other: Any?): Boolean
get
Link copied to clipboard
operator fun get(index: Int): D
Retrieves the element at the specified index of the list
getAll
Link copied to clipboard
fun getAll(): List<D>
Retrieves a snapshot of the current list
getObservable
Link copied to clipboard
fun getObservable(): Observable<ChangeMessageList<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(data: D): Boolean
Removes data from the list and emits a change message to surrounding observersThe change snapshot will contain data that was just removed
removeAll
Link copied to clipboard
fun removeAll(dataList: List<D>): Boolean
Removes dataList from the list and emits a change message to surrounding observersThe change snapshot will contain a copy of dataList that was just removed
removeAt
Link copied to clipboard
fun removeAt(index: Int): Boolean
Removes data at the specified index and emits a change message to surrounding observersThe change snapshot will contain the data that was just removed
toString
Link copied to clipboard
open fun toString(): String
update
Link copied to clipboard
fun update(index: Int, data: D): Boolean
Updates the element at the specified index with dataThe change snapshot will contain data that was just updated