java.util.concurrent
Interface Delayed

All Superinterfaces:
Comparable sample code for java.lang.Comparable definition code for java.lang.Comparable <Delayed sample code for java.util.concurrent.Delayed definition code for java.util.concurrent.Delayed >
All Known Subinterfaces:
ScheduledFuture sample code for java.util.concurrent.ScheduledFuture definition code for java.util.concurrent.ScheduledFuture <V>

public interface Delayed
extends Comparable sample code for java.lang.Comparable definition code for java.lang.Comparable <Delayed sample code for java.util.concurrent.Delayed definition code for java.util.concurrent.Delayed >

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.

Since:
1.5

Method Summary
 long getDelay sample code for java.util.concurrent.Delayed.getDelay(java.util.concurrent.TimeUnit) definition code for java.util.concurrent.Delayed.getDelay(java.util.concurrent.TimeUnit) (TimeUnit sample code for java.util.concurrent.TimeUnit definition code for java.util.concurrent.TimeUnit  unit)
          Returns the remaining delay associated with this object, in the given time unit.
 
Methods inherited from interface java.lang.Comparable sample code for java.lang.Comparable definition code for java.lang.Comparable
compareTo sample code for java.lang.Comparable.compareTo(T) definition code for java.lang.Comparable.compareTo(T)
 

Method Detail

getDelay sample code for java.util.concurrent.Delayed.getDelay(java.util.concurrent.TimeUnit) definition code for java.util.concurrent.Delayed.getDelay(java.util.concurrent.TimeUnit)

long getDelay(TimeUnit sample code for java.util.concurrent.TimeUnit definition code for java.util.concurrent.TimeUnit  unit)
Returns the remaining delay associated with this object, in the given time unit.

Parameters:
unit - the time unit
Returns:
the remaining delay; zero or negative values indicate that the delay has already elapsed