|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--net.rim.device.api.i18n.Format
|
+--net.rim.device.api.i18n.DateFormat
Defines fundamental functionality for locale-independent formatting of date/time information.
Compatible with java.text.DateFormat from Java's standard edition.
Note: Time and date interpretation is consistent with
Calendar objects. For example, the exact moment of "midnight" always
belongs to the following day.
| Field Summary | ||
static int |
AM_PM_FIELD
Useful constant for AM_PM field alignment. |
|
static int |
DATE_DEFAULT
Default date format style. |
|
static int |
DATE_FIELD
Useful constant for DATE field alignment. |
|
static int |
DATE_FULL
Full date style. |
|
static int |
DATE_LONG
Long date style. |
|
static int |
DATE_MEDIUM
Medium date style. |
|
static int |
DATE_SHORT
Short date style. |
|
static int |
DATETIME_DEFAULT
Default date-time format style. |
|
static int |
DAY_OF_WEEK_FIELD
Useful constant for DAY_OF_WEEK field alignment. |
|
static int |
ERA_FIELD
Useful constant for ERA field alignment. |
|
static long |
GUID_DATE_FORMAT_CHANGED
GUID for the global event sent when the default date format changes. |
|
static int |
HOUR_FIELD
Useful constant for HOUR field alignment. |
|
static int |
HOUR_OF_DAY_FIELD
Useful constant for HOUR_OF_DAY field alignment. |
|
static int |
MILLISECOND_FIELD
Useful constant for MILLISECOND field alignment. |
|
static int |
MINUTE_FIELD
Useful constant for MINUTE field alignment. |
|
static int |
MONTH_FIELD
Useful constant for MONTH field alignment. |
|
static int |
SECOND_FIELD
Useful constant for SECOND field alignment. |
|
static int |
TIME_DEFAULT
Default time format style. |
|
static int |
TIME_FULL
Full time style. |
|
static int |
TIME_LONG
Long time style. |
|
static int |
TIME_MEDIUM
Medium time style: typically, this style should be used by default. |
|
static int |
TIME_SHORT
Short time style. |
|
static int |
TIMEZONE_FIELD
Useful constant for TIMEZONE field alignment. |
|
static int |
YEAR_FIELD
Useful constant for YEAR field alignment. |
|
| Constructor Summary | ||
protected |
DateFormat()
Constructs new DateFormat instance. |
|
| Method Summary | ||
abstract StringBuffer |
format(Calendar date,
StringBuffer toAppendTo_o,
FieldPosition pos_io)
Retrieves formatted string representation of calendar object. |
|
StringBuffer |
format(Object obj,
StringBuffer toAppendTo_o,
FieldPosition pos_io)
Retrieves formatted string representation of object. |
|
String |
formatLocal(long date)
Retrieves formatted representation of local date. |
|
StringBuffer |
formatLocal(StringBuffer sb,
long date)
Retrieves formatted representation of local date into string buffer. |
|
static DateFormat |
getInstance(int style)
Retrieves the date formatter for the given style and the default locale. |
|
| Methods inherited from class net.rim.device.api.i18n.Format |
format, getFields |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int AM_PM_FIELD
By default, equal to Calendar.AM_PM.
public static final int DATE_DEFAULT
By default, set to DATE_MEDIUM; subclasses may override this.
public static final int DATE_FIELD
By default, equal to Calendar.DAY_OF_MONTH.
public static final int DATE_FULL
All date information should be present, including era and timezone.
public static final int DATE_LONG
For example: Wednesday, March 08, 2006.
public static final int DATE_MEDIUM
Typically, this style should used by default.
public static final int DATE_SHORT
A very abbreviated format; for example, may include only numbers for date, month, and year.
public static final int DATETIME_DEFAULT
By default, set to (DATE_DEFAULT | TIME_DEFAULT);
subclasses may override this.
public static final int DAY_OF_WEEK_FIELD
By default, equal to Calendar.DAY_OF_WEEK.
public static final int ERA_FIELD
By default, equal to CalendarExtensions#ERA.
public static final long GUID_DATE_FORMAT_CHANGED
public static final int HOUR_FIELD
By default, equal to Calendar.HOUR.
public static final int HOUR_OF_DAY_FIELD
By default, equal to Calendar.HOUR_OF_DAY.
public static final int MILLISECOND_FIELD
By default, equal to Calendar.MILLISECOND.
public static final int MINUTE_FIELD
By default, equal to Calendar.MINUTE.
public static final int MONTH_FIELD
By default, equal to Calendar.MONTH.
public static final int SECOND_FIELD
By default, equal to Calendar.SECOND.
public static final int TIME_DEFAULT
By default, set to TIME_MEDIUM; subclasses may override this.
public static final int TIME_FULL
All time information should be present, including era and timezone.
public static final int TIME_LONG
public static final int TIME_MEDIUM
public static final int TIME_SHORT
A very abbreviated format; for example, time might not include anything except hour.
public static final int TIMEZONE_FIELD
By default, set to "90" (no equivalent in Calendar).
public static final int YEAR_FIELD
By default, equal to Calendar.YEAR.
| Constructor Detail |
| Method Detail |
public abstract StringBuffer format(Calendar date, StringBuffer toAppendTo_o, FieldPosition pos_io)
Comparable to java.text.DateFormat.format in Java's standard edition.
date - Calendar object containing date to format.toAppendTo_o - String buffer to hold the formatted results.pos_io - If not null, this method should invoke Format.getFields()
and set the begin/end for this field during formatting.public StringBuffer format(Object obj, StringBuffer toAppendTo_o, FieldPosition pos_io)
Comparable to java.text.DateFormat.format in Java's standard edition.
Note: This method casts the provided object to a
Calendar, and invokes format(Calendar,StringBuffer,FieldPosition).
obj - Object to format.toAppendTo_o - String buffer to hold the formatted results.pos_io - If not null, this method should invoke Format.getFields()
and set the begin/end for this field during formatting.public final String formatLocal(long date)
date - Date/time to format.public final StringBuffer formatLocal(StringBuffer sb, long date)
sb - String buffer to hold the formatted results.date - Date/time to format.public static final DateFormat getInstance(int style)
style - Date/time format style to use (one of
DATE_FULL,
DATE_LONG,
DATE_MEDIUM,
DATE_SHORT,
DATE_DEFAULT,
TIME_FULL,
TIME_LONG,
TIME_MEDIUM,
TIME_SHORT,
TIME_DEFAULT,
DATETIME_DEFAULT).SimpleDateFormat instance with the provided style.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2009 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.