APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang.ref

pack-priv sealed Class FinalReference<T>

extends Reference<T>
permits Finalizer
Class Inheritance
Known Direct Subclasses
java.lang.ref.Finalizer

Final references, used to implement finalization

Field Summary

Inherited from java.lang.ref.Reference:
nextqueue

Constructor Summary

AccessConstructor and Description
public
FinalReference(T referent, ReferenceQueue<? super T> q)

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Overrides java.lang.ref.Reference.clear.

Clears this reference object.

public boolean
enqueue()

Overrides java.lang.ref.Reference.enqueue.

Clears this reference object, then attempts to add it to the queue with which it is registered, if any.

public T
get()

Overrides java.lang.ref.Reference.get.

Returns this reference object's referent.

Inherited from java.lang.ref.Reference:
clearImplclearInactiveFinalReferenceclonegetFromInactiveFinalReferenceisEnqueuedreachabilityFencerefersTorefersToImplstartReferenceHandlerThread

Constructor Detail

FinalReferenceback to summary
public FinalReference(T referent, ReferenceQueue<? super T> q)

Method Detail

clearback to summary
public void clear()

Overrides java.lang.ref.Reference.clear.

Doc from java.lang.ref.Reference.clear.

Clears this reference object. Invoking this method does not enqueue this object, and the garbage collector will not clear or enqueue this object.

When the garbage collector or the enqueue() method clear references they do so directly, without invoking this method.

Annotations
@Override
enqueueback to summary
public boolean enqueue()

Overrides java.lang.ref.Reference.enqueue.

Doc from java.lang.ref.Reference.enqueue.

Clears this reference object, then attempts to add it to the queue with which it is registered, if any.

If this reference is registered with a queue but not yet enqueued, the reference is added to the queue; this method is successful and returns true. If this reference is not registered with a queue, or was already enqueued (by the garbage collector, or a previous call to enqueue), this method is unsuccessful and returns false.

Memory consistency effects: Actions in a thread prior to a successful call to enqueue happen-before the reference is removed from the queue by ReferenceQueue#poll or ReferenceQueue#remove. Unsuccessful calls to enqueue have no specified memory consistency effects.

When this method clears references it does so directly, without invoking the clear() method. When the garbage collector clears and enqueues references it does so directly, without invoking the clear() method or this method.

Annotations
@Override
getback to summary
public T get()

Overrides java.lang.ref.Reference.get.

Doc from java.lang.ref.Reference.get.

Returns this reference object's referent. If this reference object has been cleared, either by the program or by the garbage collector, then this method returns null.

Annotations
@Override