Top Description Fields Constructors Methods
org.freedesktop.dbus

public Class StrongReference<T>

extends WeakReference<T>
Class Inheritance
Imports
java.lang.ref.WeakReference

An alternative to a WeakReference when you don't want that behavior.

Field Summary

Modifier and TypeField and Description
private T

Constructor Summary

AccessConstructor and Description
public
StrongReference(T _referant)

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.

Field Detail

referantback to summary
private T referant

Constructor Detail

StrongReferenceback to summary
public StrongReference(T _referant)

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.

Returns:boolean

true if this reference object was successfully enqueued; false if it was already enqueued or if it was not registered with a queue when it was created

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.

Returns:T

The object to which this reference refers, or null if this reference object has been cleared

Annotations
@Override