Delayed


Delayed java.util.concurrent

Java 5.0 comparable

An object that implements this interface has an associated delay. Typically, it is some kind of task, such as a Callable , that has been scheduled to execute at some future time. getdelay( ) returns the remaining time, measured in the specified TimeUnit . If no time remains, geTDelay( ) should return zero or a negative value. See ScheduledFuture and DelayQueue .

Figure 16-80. java.util.concurrent.Delayed

 public interface  Delayed  extends Comparable<Delayed> {  // Public Instance Methods  long  getDelay  (TimeUnit  unit  );   } 

Implementations

ScheduledFuture

Passed To

DelayQueue.{add( ) , offer( ) , put( )}

Returned By

DelayQueue.{peek( ) , poll( ) , take( )}



Java In A Nutshell
Java In A Nutshell, 5th Edition
ISBN: 0596007736
EAN: 2147483647
Year: 2004
Pages: 1220

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net