Constructor and Description |
---|
DefaultTimer()
Constructs a new default timer.
|
DefaultTimer(boolean isDaemon)
Constructs a new default timer whose associated thread may be specified
to run as a daemon.
|
DefaultTimer(String name)
Constructs a new default timer whose associated thread has the specified
name.
|
DefaultTimer(String name,
boolean isDaemon)
Constructs a new default timer whose associated thread has the specified
name, and may be specified to run as a daemon.
|
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Terminates this timer, discarding any currently scheduled tasks.
|
ITimerTask |
schedule(Runnable task,
long delay)
Schedules the specified task for execution after the specified delay.
|
ITimerTask |
schedule(Runnable task,
long delay,
long period)
Schedules the specified task for repeated execution with the specified
initial delay.
|
public DefaultTimer()
public DefaultTimer(boolean isDaemon)
isDaemon
- true
if the associated thread should run as a daemon.public DefaultTimer(String name)
name
- the name of the associated threadpublic DefaultTimer(String name, boolean isDaemon)
name
- the name of the associated threadisDaemon
- true
if the associated thread should run as a daemon.public void cancel()
public ITimerTask schedule(Runnable task, long delay)
ITimer
public ITimerTask schedule(Runnable task, long delay, long period)
Copyright © 2017–2021 SNF4J.ORG. All rights reserved.