DataController

abstract class DataController<T>(source)

Abstract controller for managing a list of data and notifying listeners on changes.

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
fun interface OnDataEventListener<T>

Listener interface for data change events.

Properties

Link copied to clipboard

Unmodifiable copy of the current list of T.

Link copied to clipboard

The mutable backing list of T.

Link copied to clipboard

Listeners to be notified on data changes.

Functions

Link copied to clipboard

Add a listener to be notified of the changes to T list.

Link copied to clipboard
open fun notifyChanged()

Notify all listeners that the data has changed.

Link copied to clipboard

Remove a listener previously register with addOnDataEventListener

Link copied to clipboard
fun reset(elements: List<T>)

Reset the data list to the given elements and notify listeners.