IT. Expert System.

Android Reference

PhantomReference


java.lang.ref

Class PhantomReference<T>



  • public class PhantomReference<T>
    extends Reference<T>
    Implements a phantom reference, which is the weakest of the three types of references. Once the garbage collector decides that an object obj is phantom-reachable, it is being enqueued on the corresponding queue, but its referent is not cleared. That is, the reference queue of the phantom reference must explicitly be processed by some application code. As a consequence, a phantom reference that is not registered with any reference queue does not make any sense.

    Phantom references are useful for implementing cleanup operations that are necessary before an object gets garbage-collected. They are sometimes more flexible than the Object.finalize() method.

    • Constructor Detail

      • PhantomReference

        public PhantomReference(T r,
                        ReferenceQueue<? super T> q)
        Constructs a new phantom reference and registers it with the given reference queue. The reference queue may be null, but this case does not make any sense, since the reference will never be enqueued, and the get() method always returns null.
        Parameters:
        r - the referent to track
        q - the queue to register the phantom reference object with
    • Method Detail

      • get

        public T get()
        Returns null. The referent of a phantom reference is not accessible.
        Overrides:
        get in class Reference<T>
        Returns:
        null (always)


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 50 / 158668737. Delta: 0.00397 с