public interface Timer
Modifier and Type | Method and Description |
---|---|
void |
schedule(org.joda.time.Duration initialDelay,
org.joda.time.Duration period)
Schedules a periodic event with specified
initialDelay and period . |
void |
scheduleOneShot(org.joda.time.Duration delay)
Schedules an one-time event to be trigger after time interval specified by passed
Duration . |
void |
setListener(TimerListener listener)
Sets the
TimerListener observation used to observe this Timer implementation |
void |
stop()
Un-schedules any events previously registered with calls to
scheduleOneShot(org.joda.time.Duration)
or schedule(org.joda.time.Duration, org.joda.time.Duration) . |
void setListener(TimerListener listener)
TimerListener
observation used to observe this Timer
implementationlistener
- The TimerListener
instance used to observe this Timer
or a null reference.void scheduleOneShot(org.joda.time.Duration delay)
Duration
.
Any events scheduled by previous calls to either scheduleOneShot(org.joda.time.Duration)
or
schedule(org.joda.time.Duration, org.joda.time.Duration)
are un-scheduled by this call.delay
- Specifies the time interval after which the one shot event will be triggered.IllegalArgumentException
- The delay
is a null reference.void schedule(org.joda.time.Duration initialDelay, org.joda.time.Duration period)
initialDelay
and period
.
Any events scheduled by previous calls to either scheduleOneShot(org.joda.time.Duration)
or
schedule(org.joda.time.Duration, org.joda.time.Duration)
are un-scheduled by this call.initialDelay
- Specifies the time interval after which the one shot event will be triggered.period
- Specifies the timer period.IllegalArgumentException
- The initialDelay
is a null reference or
period
is a null reference.void stop()
scheduleOneShot(org.joda.time.Duration)
or schedule(org.joda.time.Duration, org.joda.time.Duration)
. If no events were scheduled it does
nothing.Copyright © 2013–2023. All rights reserved.