|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.text.DateFormatSymbols
public class DateFormatSymbols
This class acts as container for locale specific date/time formatting information such as the days of the week and the months of the year.
| Constructor Summary | |
|---|---|
DateFormatSymbols()
This method loads the format symbol information for the default locale. |
|
DateFormatSymbols(Locale locale)
This method initializes a new instance of DateFormatSymbols
by loading the date format information for the specified locale. |
|
| Method Summary | |
|---|---|
Object |
clone()
Returns a new copy of this object. |
boolean |
equals(Object obj)
This method tests a specified object for equality against this object. |
String[] |
getAmPmStrings()
This method returns the list of strings used for displaying AM or PM. |
String[] |
getEras()
This method returns the list of strings used for displaying eras (e.g., "BC" and "AD"). |
static DateFormatSymbols |
getInstance()
Returns a DateFormatSymbols instance for the
default locale obtained from either the runtime itself
or one of the installed
DateFormatSymbolsProvider instances. |
static DateFormatSymbols |
getInstance(Locale locale)
Returns a DateFormatSymbols instance for the
specified locale obtained from either the runtime itself
or one of the installed
DateFormatSymbolsProvider instances. |
String |
getLocalPatternChars()
This method returns the pattern character information for this object. |
String[] |
getMonths()
This method returns the list of strings used for displaying month names (e.g., "January" and "February"). |
String[] |
getShortMonths()
This method returns the list of strings used for displaying abbreviated month names (e.g., "Jan" and "Feb"). |
String[] |
getShortWeekdays()
This method returns the list of strings used for displaying abbreviated weekday names (e.g., "Sun" and "Mon"). |
String[] |
getWeekdays()
This method returns the list of strings used for displaying weekday names (e.g., "Sunday" and "Monday"). |
String[][] |
getZoneStrings()
This method returns this list of localized timezone display strings. |
int |
hashCode()
This method returns a hash value for this object. |
void |
setAmPmStrings(String[] value)
This method sets the list of strings used to display AM/PM values to the specified list. |
void |
setEras(String[] labels)
This method sets the list of strings used to display time eras to to the specified list. |
void |
setLocalPatternChars(String chars)
This method sets the list of characters used to specific date/time formatting strings. |
void |
setMonths(String[] labels)
This method sets the list of strings used to display month names. |
void |
setShortMonths(String[] labels)
This method sets the list of strings used to display abbreviated month names. |
void |
setShortWeekdays(String[] labels)
This method sets the list of strings used to display abbreviated weekday names. |
void |
setWeekdays(String[] labels)
This method sets the list of strings used to display weekday names. |
void |
setZoneStrings(String[][] zones)
This method sets the list of display strings for time zones. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DateFormatSymbols(Locale locale)
throws MissingResourceException
DateFormatSymbols
by loading the date format information for the specified locale.
This constructor only obtains instances using the runtime's resources;
to also include DateFormatSymbolsProvider instances,
call getInstance(java.util.Locale) instead.
locale - The locale for which date formatting symbols should
be loaded.
MissingResourceException - if the resources for the specified
locale could not be found or loaded.getInstance(java.util.Locale)
public DateFormatSymbols()
throws MissingResourceException
DateFormatSymbolsProvider instances,
call getInstance() instead.
MissingResourceException - if the resources for the default
locale could not be found or loaded.getInstance()| Method Detail |
|---|
public String[] getAmPmStrings()
String array indexed by
Calendar.AM and Calendar.PM
public String[] getEras()
String
array indexed by Calendar.BC and Calendar.AD.
public String getLocalPatternChars()
SimpleDateFormat. 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):
public String[] getMonths()
Calendar.JANUARY through
Calendar.UNDECEMBER. Note that there are thirteen
elements because some calendars have thriteen months.
public String[] getShortMonths()
String array indexed by Calendar.JANUARY
through Calendar.UNDECEMBER. Note that there are thirteen
elements because some calendars have thirteen months.
public String[] getShortWeekdays()
String array indexed by Calendar.SUNDAY
through Calendar.SATURDAY. Note that the first element
of this array is ignored.
public String[] getWeekdays()
String array indexed by Calendar.SUNDAY
through Calendar.SATURDAY. Note that the first element
of this array is ignored.
public String[][] getZoneStrings()
String array where each row in
the array contains five values:
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 any
java.util.spi.TimeZoneProvider instances.
setZoneStrings(String[][])public void setAmPmStrings(String[] value)
String array indexed by
Calendar.AM and Calendar.PM
value - The new list of AM/PM display strings.public void setEras(String[] labels)
String
array indexed by Calendar.BC and Calendar.AD.
labels - The new list of era display strings.public void setLocalPatternChars(String chars)
SimpleDateFormat. 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):
chars - The new format pattern characterspublic void setMonths(String[] labels)
Calendar.JANUARY through
Calendar.UNDECEMBER. Note that there are thirteen
elements because some calendars have thriteen months.
labels - The list of month display strings.public void setShortMonths(String[] labels)
String array indexed by Calendar.JANUARY
through Calendar.UNDECEMBER. Note that there are thirteen
elements because some calendars have thirteen months.
labels - The new list of abbreviated month display strings.public void setShortWeekdays(String[] labels)
String array indexed by Calendar.SUNDAY
through Calendar.SATURDAY. Note that the first element
of this array is ignored.
labels - This list of abbreviated weekday display strings.public void setWeekdays(String[] labels)
String array indexed by Calendar.SUNDAY
through Calendar.SATURDAY. Note that the first element
of this array is ignored.
labels - This list of weekday display strings.public void setZoneStrings(String[][] zones)
String array where each row in
the array contains five values:
public boolean equals(Object obj)
null.DateFormatSymbols.
equals in class Objectobj - The Object to test for equality against.
true if the specified object is equal to this one,
false otherwise.Object.hashCode()public Object clone()
clone in class ObjectCloneablepublic int hashCode()
hashCode in class ObjectObject.equals(Object),
System.identityHashCode(Object)public static final DateFormatSymbols getInstance()
DateFormatSymbols instance for the
default locale obtained from either the runtime itself
or one of the installed
DateFormatSymbolsProvider instances.
This is equivalent to calling
getInstance(Locale.getDefault()).
DateFormatSymbols instance for the default
locale.public static final DateFormatSymbols getInstance(Locale locale)
DateFormatSymbols instance for the
specified locale obtained from either the runtime itself
or one of the installed
DateFormatSymbolsProvider instances.
locale - the locale for which an instance should be
returned.
DateFormatSymbols instance for the specified
locale.
NullPointerException - if locale is
null.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||