org.opt4j.core.config.visualization
Class DelayTask

java.lang.Object
  extended by org.opt4j.core.config.visualization.DelayTask

public class DelayTask
extends java.lang.Object

The DelayTask executes tasks immediately or delayed if they arrive too close (delay). If they arrive way too close, older tasks will be dropped.


Constructor Summary
DelayTask(long delay)
          Constructs a DelayTask.
DelayTask(long delay, int priority)
          Constructs a DelayTask with a given priority.
 
Method Summary
 void execute(java.lang.Runnable task)
          Executes the task.
protected  void finalize()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayTask

public DelayTask(long delay)
Constructs a DelayTask.

Parameters:
delay - the minimum delay between two tasks

DelayTask

public DelayTask(long delay,
                 int priority)
Constructs a DelayTask with a given priority.

Parameters:
delay - the minimum delay between two tasks
priority - the priority of the executing thread
Method Detail

execute

public void execute(java.lang.Runnable task)
Executes the task. If tasks arrive to close, some of them are dropped.

Parameters:
task - the task to be executed

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable