ChangeId

open class ChangeId

Used to identify when the state of an object has changed by incrementing an integer id. Other classes can determine when this object has changed by polling to see if the id has changed.

This is useful as an alternative to an event listener subscription model when there is no safe point in the lifecycle of an object to unsubscribe from the event listeners. Unlike event listeners, this cannot cause memory leaks.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
val EMPTY_ID: Int = 0

Functions

Link copied to clipboard
open fun checkChanged(id: Int): Boolean
Link copied to clipboard
open fun get(): Int
Link copied to clipboard
open fun isEmpty(): Boolean
Link copied to clipboard
open fun update()