public class DelayedTask
extends java.lang.Object
implements java.util.concurrent.Delayed
| Constructor and Description |
|---|
DelayedTask(Task task,
long delay,
java.util.concurrent.TimeUnit timeUnit)
The constructor of DelayedTask.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(java.util.concurrent.Delayed arg0)
Note: this class has a natural ordering that is inconsistent with equals.
|
boolean |
equals(java.lang.Object obj)
Note: this class has a natural ordering that is inconsistent with equals DelayedTasks are considered
equal when their task ID matches, no matter what the compareTo method would determine.
|
long |
getDelay(java.util.concurrent.TimeUnit unit) |
Task |
getTask()
Returns the task.
|
int |
hashCode() |
public DelayedTask(Task task, long delay, java.util.concurrent.TimeUnit timeUnit)
task - the task.delay - the delay.timeUnit - the TineUnit for the delay.public int compareTo(java.util.concurrent.Delayed arg0)
compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic long getDelay(java.util.concurrent.TimeUnit unit)
getDelay in interface java.util.concurrent.Delayedpublic Task getTask()