Code example for Delayed

Methods: getDelay

0
          TimeUnit.MILLISECONDS);
    } 
 
    public int compareTo(Delayed o) {
      long delta = this.getDelay(TimeUnit.MILLISECONDS) -
        o.getDelay(TimeUnit.MILLISECONDS);
 
      return this.equals(o) ? 0 : (delta > 0 ? 1 : -1);
    } 
 
    /** @param expirationTime the expirationTime to set */ 
    public void setExpirationTime(long expirationTime) {
      this.expirationTime = expirationTime;
    } 
  } 
}