| java.lang.Object java.text.DateFormatSymbols
DateFormatSymbols | public class DateFormatSymbols implements Serializable,Cloneable(Code) | | DateFormatSymbols is a public class for encapsulating
localizable date-time formatting data, such as the names of the
months, the names of the days of the week, and the time zone data.
DateFormat and SimpleDateFormat both use
DateFormatSymbols to encapsulate this information.
Typically you shouldn't use DateFormatSymbols directly.
Rather, you are encouraged to create a date-time formatter with the
DateFormat class's factory methods: getTimeInstance ,
getDateInstance , or getDateTimeInstance .
These methods automatically create a DateFormatSymbols for
the formatter so that you don't have to. After the
formatter is created, you may modify its format pattern using the
setPattern method. For more information about
creating formatters using DateFormat 's factory methods,
see
DateFormat .
If you decide to create a date-time formatter with a specific
format pattern for a specific locale, you can do so with:
new SimpleDateFormat(aPattern, new DateFormatSymbols(aLocale)).
DateFormatSymbols objects are cloneable. When you obtain
a DateFormatSymbols object, feel free to modify the
date-time formatting data. For instance, you can replace the localized
date-time format pattern characters with the ones that you feel easy
to remember. Or you can change the representative cities
to your favorite ones.
New DateFormatSymbols subclasses may be added to support
SimpleDateFormat for date-time formatting for additional locales.
See Also: DateFormat See Also: SimpleDateFormat See Also: java.util.SimpleTimeZone version: 1.41, 10/10/06 author: Chen-Lieh Huang |
Constructor Summary | |
public | DateFormatSymbols() Construct a DateFormatSymbols object by loading format data from
resources for the default locale. | public | DateFormatSymbols(Locale locale) Construct a DateFormatSymbols object by loading format data from
resources for the given locale. |
ampms | String ampms(Code) | | AM and PM strings. For example: "AM" and "PM". An array of
2 strings, indexed by Calendar.AM and
Calendar.PM .
|
eras | String eras(Code) | | Era strings. For example: "AD" and "BC". An array of 2 strings,
indexed by Calendar.BC and Calendar.AD .
|
localPatternChars | String localPatternChars(Code) | | Localized date-time pattern characters. For example, a locale may
wish to use 'u' rather than 'y' to represent years in its date format
pattern strings.
This string must be exactly 18 characters long, with the index of
the characters described by DateFormat.ERA_FIELD ,
DateFormat.YEAR_FIELD , etc. Thus, if the string were
"Xz...", then localized patterns would use 'X' for era and 'z' for year.
|
millisPerHour | final static int millisPerHour(Code) | | Useful constant for defining timezone offsets.
|
months | String months(Code) | | Month strings. For example: "January", "February", etc. An array
of 13 strings (some calendars have 13 months), indexed by
Calendar.JANUARY , Calendar.FEBRUARY , etc.
|
patternChars | final static String patternChars(Code) | | Unlocalized date-time pattern characters. For example: 'y', 'd', etc.
All locales use the same these unlocalized pattern characters.
|
serialVersionUID | final static long serialVersionUID(Code) | | |
shortMonths | String shortMonths(Code) | | Short month strings. For example: "Jan", "Feb", etc. An array of
13 strings (some calendars have 13 months), indexed by
Calendar.JANUARY , Calendar.FEBRUARY , etc.
|
shortWeekdays | String shortWeekdays(Code) | | Short weekday strings. For example: "Sun", "Mon", etc. An array
of 8 strings, indexed by Calendar.SUNDAY ,
Calendar.MONDAY , etc.
The element shortWeekdays[0] is ignored.
|
weekdays | String weekdays(Code) | | Weekday strings. For example: "Sunday", "Monday", etc. An array
of 8 strings, indexed by Calendar.SUNDAY ,
Calendar.MONDAY , etc.
The element weekdays[0] is ignored.
|
zoneStrings | String zoneStrings(Code) | | Localized names of time zones in this locale. This is a
two-dimensional array of strings of size n by m,
where m is at least 5. Each of the n rows is an
entry containing the localized names for a single TimeZone .
Each such row contains (with i ranging from
0..n-1):
zoneStrings[i][0] - time zone ID
zoneStrings[i][1] - long name of zone in standard
time
zoneStrings[i][2] - short name of zone in
standard time
zoneStrings[i][3] - long name of zone in daylight
savings time
zoneStrings[i][4] - short name of zone in daylight
savings time
The zone ID is not localized; it corresponds to the ID
value associated with a system time zone object. All other entries
are localized names. If a zone does not implement daylight savings
time, the daylight savings time names are ignored.
See Also: java.util.TimeZone |
DateFormatSymbols | public DateFormatSymbols()(Code) | | Construct a DateFormatSymbols object by loading format data from
resources for the default locale.
exception: java.util.MissingResourceException - if the resources for the default locale cannot befound or cannot be loaded. |
DateFormatSymbols | public DateFormatSymbols(Locale locale)(Code) | | Construct a DateFormatSymbols object by loading format data from
resources for the given locale.
exception: java.util.MissingResourceException - if the resources for the specified locale cannot befound or cannot be loaded. |
equals | public boolean equals(Object obj)(Code) | | Override equals
|
getAmPmStrings | public String[] getAmPmStrings()(Code) | | Gets ampm strings. For example: "AM" and "PM".
the ampm strings. |
getEras | public String[] getEras()(Code) | | Gets era strings. For example: "AD" and "BC".
the era strings. |
getLocalPatternChars | public String getLocalPatternChars()(Code) | | Gets localized date-time pattern characters. For example: 'u', 't', etc.
the localized date-time pattern characters. |
getMonths | public String[] getMonths()(Code) | | Gets month strings. For example: "January", "February", etc.
the month strings. |
getShortMonths | public String[] getShortMonths()(Code) | | Gets short month strings. For example: "Jan", "Feb", etc.
the short month strings. |
getShortWeekdays | public String[] getShortWeekdays()(Code) | | Gets short weekday strings. For example: "Sun", "Mon", etc.
the short weekday strings. Use Calendar.SUNDAY ,Calendar.MONDAY , etc. to index the result array. |
getWeekdays | public String[] getWeekdays()(Code) | | Gets weekday strings. For example: "Sunday", "Monday", etc.
the weekday strings. Use Calendar.SUNDAY ,Calendar.MONDAY , etc. to index the result array. |
getZoneIndex | final int getZoneIndex(String ID)(Code) | | Package private: used by SimpleDateFormat
Gets the index for the given time zone ID to obtain the timezone
strings for formatting. The time zone ID is just for programmatic
lookup. NOT LOCALIZED!!!
Parameters: ID - the given time zone ID. the index of the given time zone ID. Returns -1 ifthe given time zone ID can't be located in the DateFormatSymbols object. See Also: java.util.SimpleTimeZone |
getZoneStrings | public String[][] getZoneStrings()(Code) | | Gets timezone strings.
the timezone strings. |
hashCode | public int hashCode()(Code) | | Override hashCode.
Generates a hash code for the DateFormatSymbols object.
|
setAmPmStrings | public void setAmPmStrings(String[] newAmpms)(Code) | | Sets ampm strings. For example: "AM" and "PM".
Parameters: newAmpms - the new ampm strings. |
setEras | public void setEras(String[] newEras)(Code) | | Sets era strings. For example: "AD" and "BC".
Parameters: newEras - the new era strings. |
setLocalPatternChars | public void setLocalPatternChars(String newLocalPatternChars)(Code) | | Sets localized date-time pattern characters. For example: 'u', 't', etc.
Parameters: newLocalPatternChars - the new localized date-timepattern characters. |
setMonths | public void setMonths(String[] newMonths)(Code) | | Sets month strings. For example: "January", "February", etc.
Parameters: newMonths - the new month strings. |
setShortMonths | public void setShortMonths(String[] newShortMonths)(Code) | | Sets short month strings. For example: "Jan", "Feb", etc.
Parameters: newShortMonths - the new short month strings. |
setShortWeekdays | public void setShortWeekdays(String[] newShortWeekdays)(Code) | | Sets short weekday strings. For example: "Sun", "Mon", etc.
Parameters: newShortWeekdays - the new short weekday strings. The array shouldbe indexed by Calendar.SUNDAY ,Calendar.MONDAY , etc. |
setWeekdays | public void setWeekdays(String[] newWeekdays)(Code) | | Sets weekday strings. For example: "Sunday", "Monday", etc.
Parameters: newWeekdays - the new weekday strings. The array shouldbe indexed by Calendar.SUNDAY ,Calendar.MONDAY , etc. |
setZoneStrings | public void setZoneStrings(String[][] newZoneStrings)(Code) | | Sets timezone strings.
Parameters: newZoneStrings - the new timezone strings. |
|
|