public interface Delayed
implements Comparable<Delayed>
| java.util.concurrent.Delayed |
| |
混合式界面用于标记在给定延迟后应该执行的对象。
该接口的实现必须定义一个 compareTo方法,该方法提供与其 getDelay方法一致的排序。
Public methods |
|
|---|---|
abstract long |
getDelay(TimeUnit unit) 以给定的时间单位返回与此对象关联的剩余延迟。 |
Inherited methods |
|
|---|---|
java.lang.Comparable
|
|
long getDelay (TimeUnit unit)
以给定的时间单位返回与此对象关联的剩余延迟。
| Parameters | |
|---|---|
unit |
TimeUnit: the time unit |
| Returns | |
|---|---|
long |
the remaining delay; zero or negative values indicate that the delay has already elapsed |