接口 Timeout
public interface Timeout
-
方法概要
修饰符和类型方法说明booleancancel()Attempts to cancel theTimerTaskassociated with this handle.booleanReturnstrueif and only if theTimerTaskassociated with this handle has been cancelled.booleanReturnstrueif and only if theTimerTaskassociated with this handle has been expired.task()Returns theTimerTaskwhich is associated with this handle.timer()Returns theTimerthat created this handle.
-
方法详细资料
-
timer
Timer timer()Returns theTimerthat created this handle.- 返回:
- the
Timerthat created this handle
-
task
TimerTask task()Returns theTimerTaskwhich is associated with this handle.- 返回:
- the
TimerTaskwhich is associated with this handle
-
isExpired
boolean isExpired()Returnstrueif and only if theTimerTaskassociated with this handle has been expired.- 返回:
trueif and only if theTimerTaskassociated
-
isCancelled
boolean isCancelled()Returnstrueif and only if theTimerTaskassociated with this handle has been cancelled.- 返回:
trueif and only if theTimerTaskassociated
-
cancel
boolean cancel()Attempts to cancel theTimerTaskassociated with this handle. If the task has been executed or cancelled already, it will return with no side effect.- 返回:
- True if the cancellation completed successfully, otherwise false
-