de.frag.umlplugin.classcloud
Class DelayedExecutor

java.lang.Object
  extended by de.frag.umlplugin.classcloud.DelayedExecutor

public class DelayedExecutor
extends java.lang.Object

Executes tasks with a given delay. If a new task is scheduled for execution, existing scheduled tasks will be discarded, so only the last scheduled task is executed.


Constructor Summary
DelayedExecutor(int delay)
          Creates a new delayed executor.
 
Method Summary
 void execute(java.lang.Runnable task)
          Schedules given task for execution after delay specified in constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelayedExecutor

public DelayedExecutor(int delay)
Creates a new delayed executor.

Parameters:
delay - delay in milliseconds
Method Detail

execute

public void execute(@NotNull
                    java.lang.Runnable task)
Schedules given task for execution after delay specified in constructor. If there are any tasks that are scheduled for execution but not started, these tasks will be discarded.

Parameters:
task - task to schedule for execution