@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); return (diff == 0 ? 0 : ((diff < 0) ? -1 : 1)); } }
@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); return (diff == 0 ? 0 : ((diff < 0)? -1 : 1)); }
@Override public int compareTo(@Nonnull Delayed o) { long otherMillis = o.getDelay(TimeUnit.MILLISECONDS); return Long.compare(this.delayMillis, otherMillis); }
/** * Returns first element only if it is expired. * Used only by drainTo. Call only when holding lock. */ private E peekExpired() { // assert lock.isHeldByCurrentThread(); E first = q.peek(); return (first == null || first.getDelay(NANOSECONDS) > 0) ? null : first; }
@Override public int compareTo(Delayed o) { return new Long(getDelay(TimeUnit.MILLISECONDS)).compareTo(o.getDelay(TimeUnit.MILLISECONDS)); } }
@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); if (diff == 0) { return 0; } if (diff < 0) { return -1; } return 1; }
@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); if (diff == 0) { return 0; } if (diff < 0) { return -1; } return 1; }
@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); return (diff == 0 ? 0 : ((diff < 0)? -1 : 1)); }
@Override public int compareTo(Delayed other) { return Longs.compare(getDelay(TimeUnit.NANOSECONDS), other.getDelay(TimeUnit.NANOSECONDS)); } }
public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); return (diff == 0 ? 0 : ((diff < 0) ? -1 : 1)); }
@Override public int compareTo(Delayed o) { if (o == this) return 0; // return Long.compare(this.getDelay(TimeUnit.NANOSECONDS), o.getDelay(TimeUnit.NANOSECONDS)); // JDK 7 only long my_delay=this.getDelay(TimeUnit.NANOSECONDS), other_delay=o.getDelay(TimeUnit.NANOSECONDS); return (my_delay < other_delay) ? -1 : ((my_delay == other_delay) ? 0 : 1); } }
public int compareTo(Delayed o) { long my_delay=getDelay(TimeUnit.NANOSECONDS), other_delay=o.getDelay(TimeUnit.NANOSECONDS); // return Long.compare(my_delay, other_delay); // JDK 7 only return (my_delay < other_delay) ? -1 : ((my_delay == other_delay) ? 0 : 1); }
@Override // Note: this class has a natural ordering that is inconsistent with equals public int compareTo(Delayed rhs) { if ( rhs == this ) { return 0; } long diff = getDelay(TimeUnit.NANOSECONDS) - rhs.getDelay(TimeUnit.NANOSECONDS); return (diff == 0) ? 0 : ((diff < 0) ? -1 : 1); }
@Override public int compareTo(Delayed other) { if (this == other) { return 0; } long diff = getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS); return (diff == 0 ? 0 : ((diff < 0) ? -1 : 1)); } }
@Override public int compareTo(Delayed o) { long other = o.getDelay(TimeUnit.MILLISECONDS); long ours = getDelay(TimeUnit.MILLISECONDS); //Might overflow on, say, ms compared to Long.MAX_VALUE, TimeUnit.DAYS return (int) (ours - other); }
@Override public int compareTo(Delayed o) { long diff = getDelay(TimeUnit.MILLISECONDS) - o.getDelay(TimeUnit.MILLISECONDS); return (diff < 0) ? -1 : ((diff > 0) ? 1 : 0); }
@Override public int compareTo(Delayed other) { // Delay is compared first. If there is a tie, compare region's hash code int ret = Long.valueOf(getDelay(TimeUnit.MILLISECONDS) - other.getDelay(TimeUnit.MILLISECONDS)).intValue(); if (ret != 0) { return ret; } FlushQueueEntry otherEntry = (FlushQueueEntry) other; return hashCode() - otherEntry.hashCode(); }
@Override public int compareTo(Delayed o) { long delta = this.getDelay(TimeUnit.MILLISECONDS) - o.getDelay(TimeUnit.MILLISECONDS); return this.equals(o) ? 0 : (delta > 0 ? 1 : -1); }
@Override public int compareTo(Delayed o) { long cmp = getDelay(TimeUnit.MILLISECONDS) - o.getDelay(TimeUnit.MILLISECONDS); return cmp == 0 ? 0 : ( cmp < 0 ? -1 : 1); }
@Override public int compareTo(Delayed o) { return Ints.saturatedCast( getDelay(TimeUnit.MILLISECONDS) - o.getDelay(TimeUnit.MILLISECONDS)); }