Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.text.DateFormatSymbols
Constructor Summary | |
| |
|
Method Summary | |
Object |
|
boolean | |
String[] |
|
String[] |
|
static DateFormatSymbols |
|
static DateFormatSymbols |
|
String |
|
String[] |
|
String[] |
|
String[] |
|
String[] |
|
String[][] |
|
int |
|
void |
|
void | |
void |
|
void | |
void |
|
void |
|
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public DateFormatSymbols() throws MissingResourceException
This method loads the format symbol information for the default locale. This constructor only obtains instances using the runtime's resources; to also includeDateFormatSymbolsProvider
instances, callgetInstance()
instead.
- Throws:
MissingResourceException
- if the resources for the default locale could not be found or loaded.
- See Also:
getInstance()
public DateFormatSymbols(Locale locale) throws MissingResourceException
This method initializes a new instance ofDateFormatSymbols
by loading the date format information for the specified locale. This constructor only obtains instances using the runtime's resources; to also includeDateFormatSymbolsProvider
instances, callgetInstance(Locale)
instead.
- Parameters:
locale
- The locale for which date formatting symbols should be loaded.
- Throws:
MissingResourceException
- if the resources for the specified locale could not be found or loaded.
- See Also:
getInstance(Locale)
public boolean equals(Object obj)
This method tests a specified object for equality against this object. This will be true if and only if the specified object:
- Is not
null
.- Is an instance of
DateFormatSymbols
.- Contains identical formatting symbols to this object.
- Parameters:
obj
- TheObject
to test for equality against.
- Returns:
true
if the specified object is equal to this one,false
otherwise.
public String[] getAmPmStrings()
This method returns the list of strings used for displaying AM or PM. This is a two elementString
array indexed byCalendar.AM
andCalendar.PM
- Returns:
- The list of AM/PM display strings.
public String[] getEras()
This method returns the list of strings used for displaying eras (e.g., "BC" and "AD"). This is a two elementString
array indexed byCalendar.BC
andCalendar.AD
.
- Returns:
- The list of era disply strings.
public static final DateFormatSymbols getInstance()
Returns aDateFormatSymbols
instance for the default locale obtained from either the runtime itself or one of the installedDateFormatSymbolsProvider
instances. This is equivalent to callinggetInstance(Locale.getDefault())
.
- Returns:
- a
DateFormatSymbols
instance for the default locale.
- Since:
- 1.6
public static final DateFormatSymbols getInstance(Locale locale)
Returns aDateFormatSymbols
instance for the specified locale obtained from either the runtime itself or one of the installedDateFormatSymbolsProvider
instances.
- Parameters:
locale
- the locale for which an instance should be returned.
- Returns:
- a
DateFormatSymbols
instance for the specified locale.
- Throws:
NullPointerException
- iflocale
isnull
.
- Since:
- 1.6
public String getLocalPatternChars()
This method returns the pattern character information for this object. This is an 18 character string that contains the characters that are used in creating the date formatting strings inSimpleDateFormat
. The following are the character positions in the string and which format character they correspond to (the character in parentheses is the default value in the US English locale):
- 0 - era (G)
- 1 - year (y)
- 2 - month (M)
- 3 - day of month (d)
- 4 - hour out of 12, from 1-12 (h)
- 5 - hour out of 24, from 0-23 (H)
- 6 - minute (m)
- 7 - second (s)
- 8 - millisecond (S)
- 9 - date of week (E)
- 10 - date of year (D)
- 11 - day of week in month, eg. "4th Thur in Nov" (F)
- 12 - week in year (w)
- 13 - week in month (W)
- 14 - am/pm (a)
- 15 - hour out of 24, from 1-24 (k)
- 16 - hour out of 12, from 0-11 (K)
- 17 - time zone (z)
- Returns:
- The format patter characters
public String[] getMonths()
This method returns the list of strings used for displaying month names (e.g., "January" and "February"). This is a thirteen element string array indexed byCalendar.JANUARY
throughCalendar.UNDECEMBER
. Note that there are thirteen elements because some calendars have thriteen months.
- Returns:
- The list of month display strings.
public String[] getShortMonths()
This method returns the list of strings used for displaying abbreviated month names (e.g., "Jan" and "Feb"). This is a thirteen elementString
array indexed byCalendar.JANUARY
throughCalendar.UNDECEMBER
. Note that there are thirteen elements because some calendars have thirteen months.
- Returns:
- The list of abbreviated month display strings.
public String[] getShortWeekdays()
This method returns the list of strings used for displaying abbreviated weekday names (e.g., "Sun" and "Mon"). This is an eight elementString
array indexed byCalendar.SUNDAY
throughCalendar.SATURDAY
. Note that the first element of this array is ignored.
- Returns:
- This list of abbreviated weekday display strings.
public String[] getWeekdays()
This method returns the list of strings used for displaying weekday names (e.g., "Sunday" and "Monday"). This is an eight elementString
array indexed byCalendar.SUNDAY
throughCalendar.SATURDAY
. Note that the first element of this array is ignored.
- Returns:
- This list of weekday display strings.
public String[][] getZoneStrings()
This method returns this list of localized timezone display strings. This is a two dimensionalString
array where each row in the array contains five values:
- 0 - The non-localized time zone id string.
- 1 - The long name of the time zone (standard time).
- 2 - The short name of the time zone (standard time).
- 3 - The long name of the time zone (daylight savings time).
- 4 - the short name of the time zone (daylight savings time).
If
setZoneStrings(String[][])
has been called, then the value passed to this will be returned. Otherwise the returned array contains zone names provided by the runtime environment and anyjava.util.spi.TimeZoneProvider
instances.
- Returns:
- The list of time zone display strings.
- See Also:
setZoneStrings(String[][])
public int hashCode()
This method returns a hash value for this object.
- Returns:
- A hash value for this object.
public void setAmPmStrings(String[] value)
This method sets the list of strings used to display AM/PM values to the specified list. This is a two elementString
array indexed byCalendar.AM
andCalendar.PM
- Parameters:
value
- The new list of AM/PM display strings.
public void setEras(String[] labels)
This method sets the list of strings used to display time eras to to the specified list. This is a two elementString
array indexed byCalendar.BC
andCalendar.AD
.
- Parameters:
labels
- The new list of era display strings.
public void setLocalPatternChars(String chars)
This method sets the list of characters used to specific date/time formatting strings. This is an 18 character string that contains the characters that are used in creating the date formatting strings inSimpleDateFormat
. The following are the character positions in the string and which format character they correspond to (the character in parentheses is the default value in the US English locale):
- 0 - era (G)
- 1 - year (y)
- 2 - month (M)
- 3 - day of month (d)
- 4 - hour out of 12, from 1-12 (h)
- 5 - hour out of 24, from 0-23 (H)
- 6 - minute (m)
- 7 - second (s)
- 8 - millisecond (S)
- 9 - date of week (E)
- 10 - date of year (D)
- 11 - day of week in month, eg. "4th Thur in Nov" (F)
- 12 - week in year (w)
- 13 - week in month (W)
- 14 - am/pm (a)
- 15 - hour out of 24, from 1-24 (k)
- 16 - hour out of 12, from 0-11 (K)
- 17 - time zone (z)
- Parameters:
chars
- The new format pattern characters
public void setMonths(String[] labels)
This method sets the list of strings used to display month names. This is a thirteen element string array indexed byCalendar.JANUARY
throughCalendar.UNDECEMBER
. Note that there are thirteen elements because some calendars have thriteen months.
- Parameters:
labels
- The list of month display strings.
public void setShortMonths(String[] labels)
This method sets the list of strings used to display abbreviated month names. This is a thirteen elementString
array indexed byCalendar.JANUARY
throughCalendar.UNDECEMBER
. Note that there are thirteen elements because some calendars have thirteen months.
- Parameters:
labels
- The new list of abbreviated month display strings.
public void setShortWeekdays(String[] labels)
This method sets the list of strings used to display abbreviated weekday names. This is an eight elementString
array indexed byCalendar.SUNDAY
throughCalendar.SATURDAY
. Note that the first element of this array is ignored.
- Parameters:
labels
- This list of abbreviated weekday display strings.
public void setWeekdays(String[] labels)
This method sets the list of strings used to display weekday names. This is an eight elementString
array indexed byCalendar.SUNDAY
throughCalendar.SATURDAY
. Note that the first element of this array is ignored.
- Parameters:
labels
- This list of weekday display strings.
public void setZoneStrings(String[][] zones)
This method sets the list of display strings for time zones. This is a two dimensionalString
array where each row in the array contains five values:
- 0 - The non-localized time zone id string.
- 1 - The long name of the time zone (standard time).
- 2 - The short name of the time zone (standard time).
- 3 - The long name of the time zone (daylight savings time).
- 4 - the short name of the time zone (daylight savings time).