public int compareTo()

in src/main/java/com/amazonaws/services/sqs/SQSScheduledExecutorService.java [101:119]


        public int compareTo(Delayed other) {
            if (other == this) { // compare zero if same object
                return 0;
            }
            if (other instanceof ScheduledSQSFutureTask) {
                ScheduledSQSFutureTask<?> x = (ScheduledSQSFutureTask<?>)other;
                long diff = time - x.time;
                if (diff < 0) {
                    return -1;
                } else if (diff > 0) {
                    return 1;
                } else {
                    return 0;
                }
            }
            long d = getDelay(TimeUnit.NANOSECONDS) -
                    other.getDelay(TimeUnit.NANOSECONDS);
            return (d == 0) ? 0 : ((d < 0) ? -1 : 1);
        }