public final class Clock extends AndroidNonvisibleComponent implements Component, AlarmHandler, OnStopListener, OnResumeListener, OnDestroyListener, Deleteable
form
ACCELEROMETER_SENSITIVITY_MODERATE, ACCELEROMETER_SENSITIVITY_STRONG, ACCELEROMETER_SENSITIVITY_WEAK, ALIGNMENT_CENTER, ALIGNMENT_NORMAL, ALIGNMENT_OPPOSITE, ASSET_DIRECTORY, BUTTON_SHAPE_DEFAULT, BUTTON_SHAPE_OVAL, BUTTON_SHAPE_RECT, BUTTON_SHAPE_ROUNDED, COLOR_BLACK, COLOR_BLUE, COLOR_CYAN, COLOR_DEFAULT, COLOR_DKGRAY, COLOR_GRAY, COLOR_GREEN, COLOR_LTGRAY, COLOR_MAGENTA, COLOR_NONE, COLOR_ORANGE, COLOR_PINK, COLOR_RED, COLOR_WHITE, COLOR_YELLOW, DEFAULT_VALUE_COLOR_BLACK, DEFAULT_VALUE_COLOR_BLUE, DEFAULT_VALUE_COLOR_CYAN, DEFAULT_VALUE_COLOR_DEFAULT, DEFAULT_VALUE_COLOR_DKGRAY, DEFAULT_VALUE_COLOR_GRAY, DEFAULT_VALUE_COLOR_GREEN, DEFAULT_VALUE_COLOR_LTGRAY, DEFAULT_VALUE_COLOR_MAGENTA, DEFAULT_VALUE_COLOR_NONE, DEFAULT_VALUE_COLOR_ORANGE, DEFAULT_VALUE_COLOR_PINK, DEFAULT_VALUE_COLOR_RED, DEFAULT_VALUE_COLOR_WHITE, DEFAULT_VALUE_COLOR_YELLOW, DIRECTION_EAST, DIRECTION_MAX, DIRECTION_MIN, DIRECTION_NONE, DIRECTION_NORTH, DIRECTION_NORTHEAST, DIRECTION_NORTHWEST, DIRECTION_SOUTH, DIRECTION_SOUTHEAST, DIRECTION_SOUTHWEST, DIRECTION_WEST, FONT_DEFAULT_SIZE, LAYOUT_ORIENTATION_HORIZONTAL, LAYOUT_ORIENTATION_VERTICAL, LENGTH_FILL_PARENT, LENGTH_PREFERRED, LENGTH_UNKNOWN, SLIDER_MAX_VALUE, SLIDER_MIN_VALUE, SLIDER_THUMB_VALUE, TOAST_LENGTH_LONG, TOAST_LENGTH_SHORT, TYPEFACE_DEFAULT, TYPEFACE_MONOSPACE, TYPEFACE_SANSSERIF, TYPEFACE_SERIF
Constructor and Description |
---|
Clock() |
Clock(ComponentContainer container)
Creates a new Clock component.
|
Modifier and Type | Method and Description |
---|---|
static java.util.Calendar |
AddDays(java.util.Calendar instant,
int days) |
static java.util.Calendar |
AddHours(java.util.Calendar instant,
int hours) |
static java.util.Calendar |
AddMinutes(java.util.Calendar instant,
int minutes) |
static java.util.Calendar |
AddMonths(java.util.Calendar instant,
int months) |
static java.util.Calendar |
AddSeconds(java.util.Calendar instant,
int seconds) |
static java.util.Calendar |
AddWeeks(java.util.Calendar instant,
int weeks) |
static java.util.Calendar |
AddYears(java.util.Calendar instant,
int years) |
void |
alarm() |
static int |
DayOfMonth(java.util.Calendar instant)
Returns the day of the month.
|
static long |
Duration(java.util.Calendar start,
java.util.Calendar end)
Returns the milliseconds by which end follows start (+ or -)
|
static java.lang.String |
FormatDate(java.util.Calendar instant)
Converts and formats the given instant into a string.
|
static java.lang.String |
FormatDateTime(java.util.Calendar instant)
Converts and formats the given instant into a string.
|
static java.lang.String |
FormatTime(java.util.Calendar instant)
Converts and formats the given instant into a string.
|
static long |
GetMillis(java.util.Calendar instant)
Calendar property getter method: gets the raw millisecond representation of
a Calendar.
|
static int |
Hour(java.util.Calendar instant)
Returns the hours for the given date.
|
static java.util.Calendar |
MakeInstant(java.lang.String from)
An instant in time specified by MM/DD/YYYY hh:mm:ss or MM/DD/YYYY or hh:mm
where MM is the month (01-12), DD the day (01-31), YYYY the year
(0000-9999), hh the hours (00-23), mm the minutes (00-59) and ss
the seconds (00-59).
|
static java.util.Calendar |
MakeInstantFromMillis(long millis)
Create an Calendar from ms since 1/1/1970 00:00:00.0000
Probably should go in Calendar.
|
static int |
Minute(java.util.Calendar instant)
Returns the minutes for the given date.
|
static int |
Month(java.util.Calendar instant)
Returns the number of the month for the given instant.
|
static java.lang.String |
MonthName(java.util.Calendar instant)
Returns the name of the month for the given instant.
|
static java.util.Calendar |
Now() |
void |
onDelete() |
void |
onDestroy() |
void |
onResume() |
void |
onStop() |
static int |
Second(java.util.Calendar instant)
Returns the seconds for the given instant.
|
static long |
SystemTime()
Returns the current system time in milliseconds.
|
void |
Timer()
Default Timer event handler.
|
boolean |
TimerAlwaysFires()
TimerAlwaysFires property getter method.
|
void |
TimerAlwaysFires(boolean always)
TimerAlwaysFires property setter method: instructs when to disable
|
boolean |
TimerEnabled()
Enabled property getter method.
|
void |
TimerEnabled(boolean enabled)
Enabled property setter method: starts or stops the timer.
|
int |
TimerInterval()
Interval property getter method.
|
void |
TimerInterval(int interval)
Interval property setter method: sets the interval between timer events.
|
static int |
Weekday(java.util.Calendar instant)
Returns the weekday for the given instant.
|
static java.lang.String |
WeekdayName(java.util.Calendar instant)
Returns the name of the weekday for the given instant.
|
static int |
Year(java.util.Calendar instant)
Returns the year of the given instant.
|
getDispatchDelegate
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDispatchDelegate
public Clock(ComponentContainer container)
container
- ignored (because this is a non-visible component)public Clock()
public void Timer()
public int TimerInterval()
public void TimerInterval(int interval)
interval
- timer interval in mspublic boolean TimerEnabled()
true
indicates a running timer, false
a stopped
timerpublic void TimerEnabled(boolean enabled)
enabled
- true
starts the timer, false
stops itpublic boolean TimerAlwaysFires()
true
if the timer event will fire even if the application
is not on the screenpublic void TimerAlwaysFires(boolean always)
always
- true
if the timer event should fire even if the
application is not on the screenpublic void alarm()
alarm
in interface AlarmHandler
public static long SystemTime()
public static java.util.Calendar Now()
public static java.util.Calendar MakeInstant(java.lang.String from)
from
- string to convertpublic static java.util.Calendar MakeInstantFromMillis(long millis)
millis
- raw millisecond number.public static long GetMillis(java.util.Calendar instant)
instant
- Calendarpublic static java.util.Calendar AddSeconds(java.util.Calendar instant, int seconds)
public static java.util.Calendar AddMinutes(java.util.Calendar instant, int minutes)
public static java.util.Calendar AddHours(java.util.Calendar instant, int hours)
public static java.util.Calendar AddDays(java.util.Calendar instant, int days)
public static java.util.Calendar AddWeeks(java.util.Calendar instant, int weeks)
public static java.util.Calendar AddMonths(java.util.Calendar instant, int months)
public static java.util.Calendar AddYears(java.util.Calendar instant, int years)
public static long Duration(java.util.Calendar start, java.util.Calendar end)
start
- beginning instantend
- ending instantpublic static int Second(java.util.Calendar instant)
instant
- instant to use seconds ofpublic static int Minute(java.util.Calendar instant)
instant
- instant to use minutes ofpublic static int Hour(java.util.Calendar instant)
instant
- Calendar to use hours ofpublic static int DayOfMonth(java.util.Calendar instant)
instant
- instant to use day of the month ofpublic static int Weekday(java.util.Calendar instant)
instant
- instant to use day of week ofpublic static java.lang.String WeekdayName(java.util.Calendar instant)
instant
- instant to use weekday ofpublic static int Month(java.util.Calendar instant)
instant
- instant to use month ofpublic static java.lang.String MonthName(java.util.Calendar instant)
instant
- instant to use month ofpublic static int Year(java.util.Calendar instant)
instant
- instant to use year ofpublic static java.lang.String FormatDateTime(java.util.Calendar instant)
instant
- instant to formatpublic static java.lang.String FormatDate(java.util.Calendar instant)
instant
- instant to formatpublic static java.lang.String FormatTime(java.util.Calendar instant)
instant
- instant to formatpublic void onStop()
onStop
in interface OnStopListener
public void onResume()
onResume
in interface OnResumeListener
public void onDestroy()
onDestroy
in interface OnDestroyListener
public void onDelete()
onDelete
in interface Deleteable