public final class Clock extends Object implements Executable
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Clock.ClockEvent
ClockEvent
|
| 限定符和类型 | 字段和说明 |
|---|---|
private static String |
DEFAULT_DATE_FORMAT |
private EventBus<Clock.ClockEvent,String> |
eventBus |
private static long |
REMAING_TIME_ADJUSTMENT |
private AtomicBoolean |
running |
private ConcurrentMap<String,ClockTask> |
tasks |
| 限定符和类型 | 方法和说明 |
|---|---|
(专用程序包) void |
doRepeat(ClockTask task,
long delay,
TimeUnit timeUnit) |
(专用程序包) void |
doRepeatAtFixedRate(ClockTask task,
long remaining,
long delay) |
boolean |
execute() |
int |
getTaskCount() |
boolean |
isRunning() |
static void |
main(String[] args) |
void |
schedule(ClockTask task,
long delay,
long period,
TimeUnit timeUnit) |
void |
schedule(ClockTask task,
long delay,
TimeUnit timeUnit) |
void |
scheduleAtFixedRate(ClockTask task,
long delay,
long period,
TimeUnit timeUnit) |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonCancellation, onErrorprivate static final long REMAING_TIME_ADJUSTMENT
private final AtomicBoolean running
private final ConcurrentMap<String,ClockTask> tasks
private final EventBus<Clock.ClockEvent,String> eventBus
public Clock()
public Clock(Executor executor, boolean autoShutdownExecutor)
public void scheduleAtFixedRate(ClockTask task, long delay, long period, TimeUnit timeUnit)
void doRepeatAtFixedRate(ClockTask task, long remaining, long delay)
public boolean execute()
execute 在接口中 Executablepublic boolean isRunning()
public int getTaskCount()
public void stop()
Copyright © 2020. All rights reserved.