|
|
|||||||||
| 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>
ReferenceQueue is a list of (weak, soft or phantom) references that where cleared by the garbage collector. If a reference queue instance is provided to a newly created reference, then this reference will be enqueued automatically in this list when it is cleared by the garbage collector.
| Constructor Summary | |
|---|---|
ReferenceQueue()
Constructor to create an empty reference queue. |
|
| Method Summary | |
|---|---|
Reference<? extends T> |
poll()
poll |
Reference<? extends T> |
remove()
Remove one element from this queue. |
Reference<? extends T> |
remove(long timeout)
Remove one element from this queue. |
| 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()
public Reference<? extends T> remove(long timeout)
throws IllegalArgumentException,
InterruptedException
timeout - a timeout for blocking wait for an element in the
list, in milliseconds. A timeout of 0 will block forever.
IllegalArgumentException - if timeout is negative
InterruptedException - if the blocking wait was interrupted
via a call to Thread.interrupt().
public Reference<? extends T> remove()
throws InterruptedException
InterruptedException - if the blocking wait was interrupted
via a call to Thread.interrupt().
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||