28 |
|
* default, the task execution thread does not run as a <i>daemon thread</i>, |
29 |
|
* so it is capable of keeping an application from terminating. If a caller |
30 |
|
* wants to terminate a timer's task execution thread rapidly, the caller |
31 |
< |
* should invoke the the timer's <tt>cancel</tt> method. |
31 |
> |
* should invoke the timer's <tt>cancel</tt> method. |
32 |
|
* |
33 |
|
* <p>If the timer's task execution thread terminates unexpectedly, for |
34 |
|
* example, because its <tt>stop</tt> method is invoked, any further |
390 |
|
* <p>Fixed-rate execution is appropriate for recurring activities that |
391 |
|
* are sensitive to <i>absolute</i> time, such as ringing a chime every |
392 |
|
* hour on the hour, or running scheduled maintenance every day at a |
393 |
< |
* particular time. It is also appropriate for for recurring activities |
393 |
> |
* particular time. It is also appropriate for recurring activities |
394 |
|
* where the total time to perform a fixed number of executions is |
395 |
|
* important, such as a countdown timer that ticks once every second for |
396 |
|
* ten seconds. Finally, fixed-rate execution is appropriate for |
433 |
|
* <p>Fixed-rate execution is appropriate for recurring activities that |
434 |
|
* are sensitive to <i>absolute</i> time, such as ringing a chime every |
435 |
|
* hour on the hour, or running scheduled maintenance every day at a |
436 |
< |
* particular time. It is also appropriate for for recurring activities |
436 |
> |
* particular time. It is also appropriate for recurring activities |
437 |
|
* where the total time to perform a fixed number of executions is |
438 |
|
* important, such as a countdown timer that ticks once every second for |
439 |
|
* ten seconds. Finally, fixed-rate execution is appropriate for |
525 |
|
* |
526 |
|
* <p>Most programs will have no need to call this method. |
527 |
|
* It is designed for use by the rare application that cancels a large |
528 |
< |
* number of of tasks. Calling this method trades time for space: the |
528 |
> |
* number of tasks. Calling this method trades time for space: the |
529 |
|
* runtime of the method may be proportional to n + c log n, where n |
530 |
|
* is the number of tasks in the queue and c is the number of cancelled |
531 |
|
* tasks. |
648 |
|
* ordered on nextExecutionTime. Each Timer object has one of these, which it |
649 |
|
* shares with its TimerThread. Internally this class uses a heap, which |
650 |
|
* offers log(n) performance for the add, removeMin and rescheduleMin |
651 |
< |
* operations, and constant time performance for the the getMin operation. |
651 |
> |
* operations, and constant time performance for the getMin operation. |
652 |
|
*/ |
653 |
|
class TaskQueue { |
654 |
|
/** |