T
- the type of enqueued objectspublic final class ReferenceQueue<T>
extends java.lang.Object
There are two ways to retrieve and remove an element from the queue.
EnqueuedWeakReference
Constructor and Description |
---|
ReferenceQueue()
Creates an empty
Reference queue. |
Modifier and Type | Method and Description |
---|---|
EnqueuedWeakReference<T> |
poll()
Queries the queue and returns and removes the first element of the queue.
|
EnqueuedWeakReference<T> |
remove()
Queries the queue, returns and removes the first element of the queue.
|
@Nullable public EnqueuedWeakReference<T> poll()
null
.null
public EnqueuedWeakReference<T> remove() throws java.lang.InterruptedException
java.lang.InterruptedException
- if the thread is interrupted