DataBufferObserver

interface DataBufferObserver

Known direct subclasses
DataBufferObserverSet

Utility class for managing a set of observers and distributing their notifications.


An interface for notifying an observer about changes to a DataBuffer.

To support adding multiple observers, see DataBufferObserverSet. It allows you to delegate addObserver and removeObserver to it and it will handle distributing all the notifications to all registered observers.

See also
DataBuffer

Summary

Nested types

Interface a data buffer can implement to expose the fact that it supports observation.

Public functions

Unit

Called when the overall data changes.

Unit
onDataRangeChanged(position: Int, count: Int)

Called when a range of items changes.

Unit
onDataRangeInserted(position: Int, count: Int)

Called when a range of items is inserted.

Unit
onDataRangeMoved(fromPosition: Int, toPosition: Int, count: Int)

Called when a range of items is moved.

Unit
onDataRangeRemoved(position: Int, count: Int)

Called when a range of items is removed.

Public functions

onDataChanged

fun onDataChanged(): Unit

Called when the overall data changes.

onDataRangeChanged

fun onDataRangeChanged(position: Int, count: Int): Unit

Called when a range of items changes.

onDataRangeInserted

fun onDataRangeInserted(position: Int, count: Int): Unit

Called when a range of items is inserted.

onDataRangeMoved

fun onDataRangeMoved(fromPosition: Int, toPosition: Int, count: Int): Unit

Called when a range of items is moved.

onDataRangeRemoved

fun onDataRangeRemoved(position: Int, count: Int): Unit

Called when a range of items is removed.