474 |
this(daemon, Thread.NORM_PRIORITY); |
this(daemon, Thread.NORM_PRIORITY); |
475 |
} |
} |
476 |
|
|
477 |
/** @since 1.5 */ |
/** |
478 |
|
* Create a new Timer whose Thread has the indicated name. It will have |
479 |
|
* normal priority and will not be a daemon thread. |
480 |
|
* @param name the name of the Thread |
481 |
|
* @since 1.5 |
482 |
|
*/ |
483 |
public Timer(String name) |
public Timer(String name) |
484 |
{ |
{ |
485 |
this(false, Thread.NORM_PRIORITY, name); |
this(false, Thread.NORM_PRIORITY, name); |
486 |
} |
} |
487 |
|
|
488 |
/** @since 1.5 */ |
/** |
489 |
|
* Create a new Timer whose Thread has the indicated name. It will have |
490 |
|
* normal priority. The boolean argument controls whether or not it |
491 |
|
* will be a daemon thread. |
492 |
|
* @param name the name of the Thread |
493 |
|
* @param daemon true if the Thread should be a daemon thread |
494 |
|
* @since 1.5 |
495 |
|
*/ |
496 |
public Timer(String name, boolean daemon) |
public Timer(String name, boolean daemon) |
497 |
{ |
{ |
498 |
this(daemon, Thread.NORM_PRIORITY, name); |
this(daemon, Thread.NORM_PRIORITY, name); |
692 |
queue.setNullOnEmpty(true); |
queue.setNullOnEmpty(true); |
693 |
} |
} |
694 |
|
|
695 |
/** @since 1.5 */ |
/** |
696 |
|
* Removes all cancelled tasks from the queue. |
697 |
|
* @return the number of tasks removed |
698 |
|
* @since 1.5 |
699 |
|
*/ |
700 |
public int purge() |
public int purge() |
701 |
{ |
{ |
702 |
return queue.purge(); |
return queue.purge(); |