public final class TimerInternal
extends java.lang.Object
implements java.lang.Runnable
Constructor and Description |
---|
TimerInternal(AlarmHandler component,
boolean enabled,
int interval)
Timer constructor
|
TimerInternal(AlarmHandler component,
boolean enabled,
int interval,
android.os.Handler handler)
Timer constructor allowing injection of a mock Handler for test purposes
|
Modifier and Type | Method and Description |
---|---|
boolean |
Enabled()
Enabled property getter method.
|
void |
Enabled(boolean enabled)
Enabled property setter method: starts or stops the timer.
|
int |
Interval()
Interval getter.
|
void |
Interval(int interval)
Interval property setter method: sets the interval between timer events.
|
void |
run() |
public TimerInternal(AlarmHandler component, boolean enabled, int interval)
component
- the component whose AlarmHandler.alarm()
method
should be called on timer intervalsenabled
- whether it is initially enabledinterval
- time in mspublic TimerInternal(AlarmHandler component, boolean enabled, int interval, android.os.Handler handler)
component
- the component whose AlarmHandler.alarm()
method
should be called on timer intervalsenabled
- whether it is initially enabledinterval
- time in mshandler
- the handler whose Handler.postDelayed(Runnable, long)
method is called to request calls of this after the delay
specified via Interval(int)
public int Interval()
public void Interval(int interval)
interval
- timer interval in mspublic boolean Enabled()
true
indicates a running timer, false
a stopped
timerpublic void Enabled(boolean enabled)
enabled
- true
starts the timer, false
stops itpublic void run()
run
in interface java.lang.Runnable