Public Member Functions | |
LastExecutor () | |
LastExecutor (int delayMillis) | |
LastExecutor (boolean execOnlyLast) | |
LastExecutor (int delayMillis, boolean execOnlyLast) | |
synchronized boolean | isExecOnlyLast () |
synchronized void | setExecOnlyLast (boolean execOnlyLast) |
synchronized int | getDelayMillis () |
synchronized void | setDelayMillis (int delayMillis) |
synchronized void | execute (Runnable command) |
synchronized void | join () throws InterruptedException |
synchronized void | clear () |
Static Public Member Functions | |
static void | main (String[] args) throws InterruptedException |
Private Attributes | |
int | delayMillis |
boolean | execOnlyLast |
DelayQueue< RunDelayed > | queue = new DelayQueue<RunDelayed>() |
Thread | workerThread = null |
Classes | |
class | LastExecutorThread |
class | RunDelayed |
Definition at line 40 of file LastExecutor.java.
|
Creates an empty LastExecutor with a delay of 0 and execOnlyLast set to true. Definition at line 68 of file LastExecutor.java. Referenced by ikayaki.util.LastExecutor.main(). |
|
Creates an empty LastExecutor with execOnlyLast set to true.
Definition at line 77 of file LastExecutor.java. |
|
Creates an empty LastExecutor with a delay of 0.
Definition at line 87 of file LastExecutor.java. |
|
Creates an empty LastExecutor.
Definition at line 98 of file LastExecutor.java. |
|
Removes all of the elements from the execution queue. The queue will be empty after this call returns. The execution thread will stop after the currently running task, if any. Definition at line 175 of file LastExecutor.java. References ikayaki.util.LastExecutor.queue, and ikayaki.util.LastExecutor.workerThread. Referenced by ikayaki.Project.saveNow(). |
|
|
Definition at line 124 of file LastExecutor.java. References ikayaki.util.LastExecutor.delayMillis. |
|
Definition at line 109 of file LastExecutor.java. References ikayaki.util.LastExecutor.execOnlyLast. |
|
Waits for the queue to become empty.
Definition at line 165 of file LastExecutor.java. References ikayaki.util.LastExecutor.workerThread. Referenced by ikayaki.squid.Handler.join(). |
|
TEST METHOD Definition at line 281 of file LastExecutor.java. References ikayaki.util.LastExecutor.execute(), and ikayaki.util.LastExecutor.LastExecutor(). |
Here is the call graph for this function:
|
Definition at line 131 of file LastExecutor.java. |
|
Definition at line 117 of file LastExecutor.java. |
|
Defines how long is the delay in milliseconds, after which the events need to be run. Definition at line 45 of file LastExecutor.java. Referenced by ikayaki.util.LastExecutor.execute(), and ikayaki.util.LastExecutor.getDelayMillis(). |
|
Defines if only the last event should be executed. If false, then all of the events are executed in the order of appearance. Definition at line 51 of file LastExecutor.java. Referenced by ikayaki.util.LastExecutor.execute(), and ikayaki.util.LastExecutor.isExecOnlyLast(). |
|
Prioritized FIFO queue for containing the RunDelayed items that have not expired. If execOnlyLast is true, then this queue should never contain more than one item. Definition at line 57 of file LastExecutor.java. Referenced by ikayaki.util.LastExecutor.clear(), and ikayaki.util.LastExecutor.execute(). |
|
The worker thread that will run the inserted runnables. If the thread has no more work to do, it will set workerThread to null and terminate itself. Definition at line 63 of file LastExecutor.java. Referenced by ikayaki.util.LastExecutor.clear(), ikayaki.util.LastExecutor.execute(), and ikayaki.util.LastExecutor.join(). |