1 /* 2 * @(#)Delayed.java 1.6 04/04/14 3 * 4 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 5 * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 6 */ 7 8 package java.util.concurrent; 9 10 import java.util.*; 11 12 /** 13 * A mix-in style interface for marking objects that should be 14 * acted upon after a given delay. 15 * 16 * <p>An implementation of this interface must define a 17 * <tt>compareTo</tt> method that provides an ordering consistent with 18 * its <tt>getDelay</tt> method. 19 * 20 * @since 1.5 21 * @author Doug Lea 22 */ 23 public interface Delayed extends Comparable<Delayed> { 24 25 /** 26 * Returns the remaining delay associated with this object, in the 27 * given time unit. 28 * 29 * @param unit the time unit 30 * @return the remaining delay; zero or negative values indicate 31 * that the delay has already elapsed 32 */ 33 long getDelay(TimeUnit unit); 34 } 35