Entry

One binding of a value to a class via a ClassValue. States are:

  • promise if value == Entry.this

  • else dead if version == null

  • else stale if version != classValue.version

  • else live Promises are never put into the cache; they only live in the backing map while a computeValue call is in flight. Once an entry goes stale, it can be reset at any time into the dead state.

Constructors

Link copied to clipboard
constructor(version: KClassValue.Version<T>?, value: T?)
constructor(version: KClassValue.Version<T>?)

For creating a promise.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val value: Any?

Functions

Link copied to clipboard
Link copied to clipboard
open fun clear()

Clears this reference. The default implementation simply clears the referent.

Link copied to clipboard
open fun enqueue(): Boolean

Clears this reference and enqueues it in its associated ReferenceQueue, if any.

Link copied to clipboard
open fun get(): KClassValue.Version<T>?

Returns the referent or null if it has been cleared.

Link copied to clipboard

Checks whether the referent equals the given obj.

Link copied to clipboard
Link copied to clipboard
fun value(): T

Fetch the value. This entry must not be a promise.

Link copied to clipboard