public enum SimpleScheduleType extends Enum<SimpleScheduleType>
SimpleTrigger is
scheduled with a ScheduledExecutorService.| Enum Constant and Description |
|---|
AT_FIXED_RATE
Used to schedule a command using
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
. |
WITH_FIXED_DELAY
Used to schedule a command using
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit) |
| Modifier and Type | Method and Description |
|---|---|
abstract ScheduledFuture<?> |
schedule(ScheduledExecutorService scheduler,
Runnable command,
long initialDelay,
long rate,
TimeUnit unit)
Schedules a
Runnable according to this scheduling type. |
static SimpleScheduleType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SimpleScheduleType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SimpleScheduleType AT_FIXED_RATE
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
.public static final SimpleScheduleType WITH_FIXED_DELAY
ScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)public static SimpleScheduleType[] values()
for (SimpleScheduleType c : SimpleScheduleType.values()) System.out.println(c);
public static SimpleScheduleType valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic abstract ScheduledFuture<?> schedule(ScheduledExecutorService scheduler, Runnable command, long initialDelay, long rate, TimeUnit unit)
Runnable according to this scheduling type.scheduler - The scheduler to schedule the command with.command - The command to schedule.initialDelay - The initial delay.rate - The scheduling rate.unit - Time unit in which rate and delay are interpreted.Copyright © 2014–2018. All rights reserved.