#include <dtfmtsym.h>
Public Methods | |
DateFormatSymbols (UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the default locale. More... | |
DateFormatSymbols (const Locale &locale, UErrorCode &status) | |
Construct a DateFormatSymbols object by loading format data from resources for the given locale. More... | |
DateFormatSymbols (const DateFormatSymbols &) | |
Copy constructor. More... | |
DateFormatSymbols & | operator= (const DateFormatSymbols &) |
Assignment operator. More... | |
~DateFormatSymbols () | |
Destructor. More... | |
UBool | operator== (const DateFormatSymbols &other) const |
Return true if another object is semantically equal to this one. More... | |
UBool | operator!= (const DateFormatSymbols &other) const |
Return true if another object is semantically unequal to this one. More... | |
const UnicodeString * | getEras (int32_t &count) const |
Gets era strings. More... | |
void | setEras (const UnicodeString *eras, int32_t count) |
Sets era strings. More... | |
const UnicodeString * | getMonths (int32_t &count) const |
Gets month strings. More... | |
void | setMonths (const UnicodeString *months, int32_t count) |
Sets month strings. More... | |
const UnicodeString * | getShortMonths (int32_t &count) const |
Gets short month strings. More... | |
void | setShortMonths (const UnicodeString *shortMonths, int32_t count) |
Sets short month strings. More... | |
const UnicodeString * | getWeekdays (int32_t &count) const |
Gets weekday strings. More... | |
void | setWeekdays (const UnicodeString *weekdays, int32_t count) |
Sets weekday strings. More... | |
const UnicodeString * | getShortWeekdays (int32_t &count) const |
Gets short weekday strings. More... | |
void | setShortWeekdays (const UnicodeString *shortWeekdays, int32_t count) |
Sets short weekday strings. More... | |
const UnicodeString * | getAmPmStrings (int32_t &count) const |
Gets AM/PM strings. More... | |
void | setAmPmStrings (const UnicodeString *ampms, int32_t count) |
Sets ampm strings. More... | |
const UnicodeString ** | getZoneStrings (int32_t &rowCount, int32_t &columnCount) const |
Gets timezone strings. More... | |
void | setZoneStrings (const UnicodeString *const *strings, int32_t rowCount, int32_t columnCount) |
Sets timezone strings. More... | |
UnicodeString & | getLocalPatternChars (UnicodeString &result) const |
Gets localized date-time pattern characters. More... | |
void | setLocalPatternChars (const UnicodeString &newLocalPatternChars) |
Sets localized date-time pattern characters. More... | |
Static Public Methods | |
const UnicodeString & | getPatternChars (void) |
Get the non-localized date-time pattern characters. More... | |
const UChar * | getPatternUChars (void) |
Get the non-localized date-time pattern characters. More... | |
Friends | |
class | SimpleDateFormat |
DateFormatSymbols is used by DateFormat and SimpleDateFormat.
Rather than first creating a DateFormatSymbols to get a date-time formatter by using a SimpleDateFormat constructor, clients are encouraged to create a date-time formatter using the getTimeInstance(), getDateInstance(), or getDateTimeInstance() method in DateFormat. Each of these methods can return a date/time formatter initialized with a default format pattern along with the date-time formatting data for a given or default locale. After a formatter is created, clients may modify the format pattern using the setPattern function as so desired. For more information on using these formatter factory functions, see DateFormat.
If clients decide to create a date-time formatter with a particular format pattern and locale, they can do so with new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)). This will load the appropriate date-time formatting data from the locale.
DateFormatSymbols objects are clonable. When clients obtain a DateFormatSymbols object, they can feel free to modify the date-time formatting data as necessary. For instance, clients can replace the localized date-time format pattern characters with the ones that they feel easy to remember. Or they can change the representative cities originally picked by default to using their favorite ones.
New DateFormatSymbols sub-classes may be added to support SimpleDateFormat for date-time formatting for additional locales.
|
Construct a DateFormatSymbols object by loading format data from resources for the default locale.
NOTE: This constructor will never fail; if it cannot get resource data for the default locale, it will return a last-resort object based on hard-coded strings.
|
|
Construct a DateFormatSymbols object by loading format data from resources for the given locale.
|
|
Copy constructor. @stable |
|
Destructor. This is nonvirtual because this class is not designed to be subclassed. @stable |
|
Gets AM/PM strings. For example: "AM" and "PM".
|
|
Gets era strings. For example: "AD" and "BC".
|
|
Gets localized date-time pattern characters. For example: 'u', 't', etc.
|
|
Gets month strings. For example: "January", "February", etc.
|
|
Get the non-localized date-time pattern characters.
|
|
Get the non-localized date-time pattern characters. @stable |
|
Gets short month strings. For example: "Jan", "Feb", etc.
|
|
Gets short weekday strings. For example: "Sun", "Mon", etc.
|
|
Gets weekday strings. For example: "Sunday", "Monday", etc.
|
|
Gets timezone strings. These strings are stored in a 2-dimensional array.
|
|
Return true if another object is semantically unequal to this one. @stable |
|
Assignment operator. @stable |
|
Return true if another object is semantically equal to this one. @stable |
|
Sets ampm strings. For example: "AM" and "PM".
|
|
Sets era strings. For example: "AD" and "BC".
|
|
Sets localized date-time pattern characters. For example: 'u', 't', etc.
|
|
Sets month strings. For example: "January", "February", etc.
|
|
Sets short month strings. For example: "Jan", "Feb", etc.
|
|
Sets short weekday strings. For example: "Sun", "Mon", etc.
|
|
Sets weekday strings. For example: "Sunday", "Monday", etc.
|
|
Sets timezone strings. These strings are stored in a 2-dimensional array.
|