TimerOngoingActivityStatus
public
class
TimerOngoingActivityStatus
extends OngoingActivityStatus
OngoingActivityStatus
representing a timer or stopwatch.
Summary
Public constructors |
TimerOngoingActivityStatus(long timeZeroMillis, boolean countDown, long pausedAtMillis, long totalDurationMillis)
Create a Status representing a timer or stopwatch.
|
TimerOngoingActivityStatus(long timeZeroMillis, boolean countDown, long pausedAtMillis)
Create a Status representing a timer or stopwatch.
|
TimerOngoingActivityStatus(long timeZeroMillis, boolean countDown)
Create a Status representing a timer or stopwatch.
|
TimerOngoingActivityStatus(long timeZeroMillis)
Create a Status representing stopwatch.
|
Inherited methods |
|
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
final
void
|
wait()
|
|
Public constructors
TimerOngoingActivityStatus
public TimerOngoingActivityStatus (long timeZeroMillis,
boolean countDown,
long pausedAtMillis,
long totalDurationMillis)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
long : timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean : indicates if this is a stopwatch (when false or timer
(when true ). |
pausedAtMillis |
long : timestamp of the time when this timer was paused. Or
-1L if this
timer is running. |
totalDurationMillis |
long : total duration of this timer/stopwatch, useful to display as a
progress bar or similar.
|
TimerOngoingActivityStatus
public TimerOngoingActivityStatus (long timeZeroMillis,
boolean countDown,
long pausedAtMillis)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
long : timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean : indicates if this is a stopwatch (when false ) or timer
(when true ). |
pausedAtMillis |
long : timestamp of the time when this timer was paused. Or
-1L if this timer is running.
|
TimerOngoingActivityStatus
public TimerOngoingActivityStatus (long timeZeroMillis,
boolean countDown)
Create a Status representing a timer or stopwatch.
Parameters |
timeZeroMillis |
long : timestamp of the time at which this Timer should display 0,
will be in the
past for a stopwatch and usually in the future for timers. |
countDown |
boolean : indicates if this is a stopwatch (when false ) or timer
(when true ).
|
TimerOngoingActivityStatus
public TimerOngoingActivityStatus (long timeZeroMillis)
Create a Status representing stopwatch.
Parameters |
timeZeroMillis |
long : timestamp of the time at which this Stopwatch started.
|
Public methods
equals
public boolean equals (Object o)
getNextChangeTimeMillis
public long getNextChangeTimeMillis (long fromTimeMillis)
See OngoingActivityStatus.getNextChangeTimeMillis(long)
Parameters |
fromTimeMillis |
long : current time, usually now as returned by
SystemClock.elapsedRealtime() . In most cases
getText and getNextChangeTimeMillis should be called
with the exact same timestamp, so changes are not missed. |
Returns |
long |
the first point in time after fromTimeMillis when the displayed value of
this status will change. returns Long.MAX_VALUE if the display will never change.
|
getPausedAtMillis
public long getPausedAtMillis ()
Returns |
long |
the timestamp of the time when this timer was paused. Use
isPaused() to determine if this timer is paused or not.
|
getTimeZeroMillis
public long getTimeZeroMillis ()
Returns |
long |
the time at which this Timer will display 0, will be in the past for a stopwatch
and usually in the future for timers.
|
getTotalDurationMillis
public long getTotalDurationMillis ()
Returns |
long |
the total duration of this timer/stopwatch, if set. Use
hasTotalDuration() to determine if this timer has a
duration set.
|
hasTotalDuration
public boolean hasTotalDuration ()
Determines if this timer has a total duration set.
Returns |
boolean |
true if this the total duration was set, false if not.
|
hashCode
public int hashCode ()
isCountDown
public boolean isCountDown ()
Returns |
boolean |
false if this is a stopwatch or true if this is a timer.
|
isPaused
public boolean isPaused ()
Determines if this timer is paused. i.e. the display representation will not change over
time.
Returns |
boolean |
true if this timer is paused, false if it's running.
|