Delayed
Stay organized with collections
Save and categorize content based on your preferences.
Known Indirect Subclasses
|
A mix-in style interface for marking objects that should be
acted upon after a given delay.
An implementation of this interface must define a
compareTo
method that provides an ordering consistent with
its getDelay
method.
Public Method Summary
abstract
long
|
getDelay( TimeUnit unit)
Returns the remaining delay associated with this object, in the
given time unit.
|
Public Methods
public
abstract
long
getDelay
(TimeUnit unit)
Returns the remaining delay associated with this object, in the
given time unit.
Returns
- the remaining delay; zero or negative values indicate
that the delay has already elapsed
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[null,null,["Last updated 2024-07-10 UTC."],[],["The `Delayed` interface marks objects for delayed actions and requires implementations to define `compareTo` and `getDelay`. `getDelay` returns the remaining delay in a specified `TimeUnit`. Zero or negative values from `getDelay` signal the delay has passed. `compareTo` provides an ordering consistent with `getDelay`. Indirect subclasses include `RunnableScheduledFuture` and `ScheduledFuture`, representing cancellable, delayed, result-bearing actions that may also be `Runnable`.\n"],null,[]]