java.lang.ref
public class ReferenceQueue<T> extends Object
See Also: enqueue
| Constructor Summary | |
|---|---|
| ReferenceQueue()
Creates a new empty reference queue. | |
| Method Summary | |
|---|---|
| Reference<? extends T> | poll()
Checks if there is a reference on the queue, returning it
immediately. |
| Reference<? extends T> | remove(long timeout)
Removes a reference from the queue, blocking for timeout
until a reference is enqueued. |
| Reference<? extends T> | remove()
Removes a reference from the queue, blocking until a reference is
enqueued.
|
Returns: a reference on the queue, if there is one,
null otherwise.
timeout
until a reference is enqueued.Parameters: timeout the timeout period in milliseconds, 0 means
wait forever.
Returns: the reference removed from the queue, or
null if timeout period expired.
Throws: InterruptedException if the wait was interrupted.
Returns: the reference removed from the queue.
Throws: InterruptedException if the wait was interrupted.