1/* 2 * Written by Doug Lea with assistance from members of JCP JSR-166 3 * Expert Group and released to the public domain, as explained at 4 * http://creativecommons.org/licenses/publicdomain 5 */ 6 7/* 8 * Modified in Apache Harmony to comply with Java 5 signature 9 * specification. 10 */ 11 12package java.util.concurrent; 13 14import java.util.*; 15 16// BEGIN android-note 17// Added generic type Delayed to Comparable to be closer to the RI. 18// END android-note 19 20/** 21 * A mix-in style interface for marking objects that should be 22 * acted upon after a given delay. 23 * 24 * <p>An implementation of this interface must define a 25 * <tt>compareTo</tt> method that provides an ordering consistent with 26 * its <tt>getDelay</tt> method. 27 * 28 * @since 1.5 29 * @author Doug Lea 30 */ 31public interface Delayed extends Comparable<Delayed> { 32 33 /** 34 * Returns the remaining delay associated with this object, in the 35 * given time unit. 36 * 37 * @param unit the time unit 38 * @return the remaining delay; zero or negative values indicate 39 * that the delay has already elapsed 40 */ 41 long getDelay(TimeUnit unit); 42} 43