WeakObjectTypeReference

class WeakObjectTypeReference(objectType: AvailObject) : WeakReference<AvailObject>

A WeakObjectTypeReference is a specialization of WeakReference that weakly holds an AvailObject which is always an object type whose descriptor indicates it's Mutability.SHARED. It also holds that object type's hash value.

Author

Mark van Gulik

Parameters

objectType

The object type to hold weakly.

Constructors

Link copied to clipboard
fun WeakObjectTypeReference(objectType: AvailObject)

Create the instance, caching the hash value.

Functions

Link copied to clipboard
open fun clear()
Link copied to clipboard
open fun enqueue(): Boolean
Link copied to clipboard
open fun get(): AvailObject?
Link copied to clipboard
open fun isEnqueued(): Boolean
Link copied to clipboard
fun matches(someHash: Int, someObjectType: AvailObject): Boolean

Check if the given someObjectType and its hash value correspond with the stored content.

Link copied to clipboard
fun refersTo(p0: AvailObject): Boolean

Properties

Link copied to clipboard
val hash: Int

The cached hash value of the object type.