类 DelayedElement<T>

java.lang.Object
com.alibaba.ageiport.common.lang.DelayedElement<T>
类型参数:
T -
所有已实现的接口:
Comparable<Delayed>, Delayed

public class DelayedElement<T> extends Object implements Delayed
延迟
作者:
lingyue
  • 构造器详细资料

    • DelayedElement

      public DelayedElement(long delay, T data)
  • 方法详细资料

    • getDelay

      public long getDelay(TimeUnit unit)
      需要实现的接口,获得延迟时间 用过期时间-当前时间
      指定者:
      getDelay 在接口中 Delayed
      参数:
      unit -
      返回:
    • compareTo

      public int compareTo(Delayed o)
      用于延迟队列内部比较排序 当前时间的延迟时间 - 比较对象的延迟时间
      指定者:
      compareTo 在接口中 Comparable<T>
      参数:
      o -
      返回:
    • toString

      public String toString()
      覆盖:
      toString 在类中 Object
    • equals

      public boolean equals(Object o)
      覆盖:
      equals 在类中 Object
    • hashCode

      public int hashCode()
      覆盖:
      hashCode 在类中 Object