Class DelayTask
- java.lang.Object
-
- org.opt4j.core.config.visualization.DelayTask
-
public class DelayTask extends java.lang.Object
TheDelayTask
executes tasks immediately or delayed if they arrive too close (delay). If they arrive way too close, older tasks will be dropped.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.Runnable task)
Executes the task.protected void
finalize()
-
-
-
Constructor Detail
-
DelayTask
public DelayTask(long delay)
Constructs aDelayTask
.- Parameters:
delay
- the minimum delay between two tasks
-
DelayTask
public DelayTask(long delay, int priority)
Constructs aDelayTask
with a given priority.- Parameters:
delay
- the minimum delay between two taskspriority
- 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 classjava.lang.Object
- Throws:
java.lang.Throwable
-
-