|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjava.lang.ref.ReferenceQueue<T>
public class ReferenceQueue<T>
引用队列,在检测到适当的可到达性更改后,垃圾回收器将已注册的引用对象添加到该队列中。
| 构造方法摘要 | |
|---|---|
ReferenceQueue()
构造一个新的引用对象队列。 |
|
| 方法摘要 | |
|---|---|
Reference<? extends T> |
poll()
轮询此队列,查看是否存在可用的引用对象。 |
Reference<? extends T> |
remove()
移除此队列中的下一个引用对象,阻塞到某个对象变得可用为止。 |
Reference<? extends T> |
remove(long timeout)
移除此队列中的下一个引用对象,阻塞到有一个对象变得可用或者给定的超时期满了为止。 |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 构造方法详细信息 |
|---|
public ReferenceQueue()
| 方法详细信息 |
|---|
public Reference<? extends T> poll()
null。
public Reference<? extends T> remove(long timeout)
throws IllegalArgumentException,
InterruptedException
此方法不提供实时保证:它安排了超时时间,就像调用 Object.wait(long) 方法一样。
timeout - 如果为正,则在等待要在此队列中添加的引用时会阻塞 timeout 毫秒。如果超时值为零,则无限期地阻塞。
null。
IllegalArgumentException - 如果超时参数的值为负。
InterruptedException - 如果超时等待被中断
public Reference<? extends T> remove()
throws InterruptedException
InterruptedException - 如果等待被中断
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。