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. package java.util.concurrent;
  8. import java.util.*;
  9. /**
  10. * A mix-in style interface for marking objects that should be
  11. * acted upon after a given delay.
  12. *
  13. * <p>An implementation of this interface must define a
  14. * <tt>compareTo</tt> method that provides an ordering consistent with
  15. * its <tt>getDelay</tt> method.
  16. *
  17. * @since 1.5
  18. * @author Doug Lea
  19. */
  20. public interface Delayed extends Comparable<Delayed> {
  21. /**
  22. * Returns the remaining delay associated with this object, in the
  23. * given time unit.
  24. *
  25. * @param unit the time unit
  26. * @return the remaining delay; zero or negative values indicate
  27. * that the delay has already elapsed
  28. */
  29. long getDelay(TimeUnit unit);
  30. }