SMILA 1.0 API documentation

org.eclipse.smila.workermanager.keepalive
Class DelayedTask

java.lang.Object
  extended by org.eclipse.smila.workermanager.keepalive.DelayedTask
All Implemented Interfaces:
java.lang.Comparable<java.util.concurrent.Delayed>, java.util.concurrent.Delayed

public class DelayedTask
extends java.lang.Object
implements java.util.concurrent.Delayed

Delayed Task to keep tasks in a temporal ordering. Note: this class has a natural ordering that is inconsistent with equals.


Constructor Summary
DelayedTask(Task task, long delay, java.util.concurrent.TimeUnit timeUnit)
          The constructor of DelayedTask.
 
Method Summary
 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()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayedTask

public DelayedTask(Task task,
                   long delay,
                   java.util.concurrent.TimeUnit timeUnit)
The constructor of DelayedTask.

Parameters:
task - the task.
delay - the delay.
timeUnit - the TineUnit for the delay.
Method Detail

compareTo

public int compareTo(java.util.concurrent.Delayed arg0)
Note: this class has a natural ordering that is inconsistent with equals.

Specified by:
compareTo in interface java.lang.Comparable<java.util.concurrent.Delayed>

equals

public 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.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getDelay

public long getDelay(java.util.concurrent.TimeUnit unit)

Specified by:
getDelay in interface java.util.concurrent.Delayed

getTask

public Task getTask()
Returns the task.

Returns:
the task

SMILA 1.0 API documentation