|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.ref.ReferenceQueue<T>
public class ReferenceQueue<T>
The ReferenceQueue is the container on which reference objects are
enqueued when the garbage collector detects the reachability type specified
for the referent.
| Constructor Summary | |
|---|---|
ReferenceQueue()
Constructs a new instance of this class. |
|
| Method Summary | |
|---|---|
(package private) void |
enqueue(Reference<? extends T> toQueue)
Enqueues the reference object on the receiver. |
Reference<? extends T> |
poll()
Returns the next available reference from the queue, removing it in the process. |
Reference<? extends T> |
remove()
Returns the next available reference from the queue, removing it in the process. |
Reference<? extends T> |
remove(long timeout)
Returns the next available reference from the queue, removing it in the process. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReferenceQueue()
| Method Detail |
|---|
public Reference<? extends T> poll()
null if no reference is
immediately available
public Reference<? extends T> remove()
throws InterruptedException
InterruptedException - if the blocking call was interrupted for some reason
public Reference<? extends T> remove(long timeout)
throws IllegalArgumentException,
InterruptedException
timeout - maximum time (in ms) to spend waiting for a reference object
to become available. A value of zero results in the method
waiting indefinitely.
null if no reference
becomes available within the timeout period
IllegalArgumentException - if the wait period is negative.
InterruptedException - if the blocking call was interrupted for some reasonvoid enqueue(Reference<? extends T> toQueue)
toQueue - reference object to be enqueued.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||