java.text
Class DateFormatSymbols
- Cloneable, Serializable
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.
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.
|
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.
|
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
equals
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.
- equals in interface Object
obj
- The Object
to test for equality against.
true
if the specified object is equal to this one,
false
otherwise.
getAmPmStrings
public String[] getAmPmStrings()
This method returns the list of strings used for displaying AM or PM.
This is a two element String
array indexed by
Calendar.AM
and Calendar.PM
- The list of AM/PM display strings.
getEras
public String[] getEras()
This method returns the list of strings used for displaying eras
(e.g., "BC" and "AD"). This is a two element String
array indexed by Calendar.BC
and Calendar.AD
.
- The list of era disply strings.
getLocalPatternChars
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 in
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):
- 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)
- The format patter characters
getMonths
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 by Calendar.JANUARY
through
Calendar.UNDECEMBER
. Note that there are thirteen
elements because some calendars have thriteen months.
- The list of month display strings.
getShortMonths
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 element
String
array indexed by Calendar.JANUARY
through Calendar.UNDECEMBER
. Note that there are thirteen
elements because some calendars have thirteen months.
- The list of abbreviated month display strings.
getShortWeekdays
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 element
String
array indexed by Calendar.SUNDAY
through Calendar.SATURDAY
. Note that the first element
of this array is ignored.
- This list of abbreviated weekday display strings.
getWeekdays
public String[] getWeekdays()
This method returns the list of strings used for displaying weekday
names (e.g., "Sunday" and "Monday"). This is an eight element
String
array indexed by Calendar.SUNDAY
through Calendar.SATURDAY
. Note that the first element
of this array is ignored.
- This list of weekday display strings.
getZoneStrings
public String[][] getZoneStrings()
This method returns this list of localized timezone display strings.
This is a two dimensional
String
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 any
java.util.spi.TimeZoneProvider
instances.
- The list of time zone display strings.
hashCode
public int hashCode()
This method returns a hash value for this object.
- hashCode in interface Object
- A hash value for this object.
setAmPmStrings
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 element String
array indexed by
Calendar.AM
and Calendar.PM
value
- The new list of AM/PM display strings.
setEras
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 element String
array indexed by Calendar.BC
and Calendar.AD
.
labels
- The new list of era display strings.
setLocalPatternChars
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 in
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):
- 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)
chars
- The new format pattern characters
setMonths
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 by Calendar.JANUARY
through
Calendar.UNDECEMBER
. Note that there are thirteen
elements because some calendars have thriteen months.
labels
- The list of month display strings.
setShortMonths
public void setShortMonths(String[] labels)
This method sets the list of strings used to display abbreviated month
names.
This is a thirteen element
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.
setShortWeekdays
public void setShortWeekdays(String[] labels)
This method sets the list of strings used to display abbreviated
weekday names.
This is an eight element
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.
setWeekdays
public void setWeekdays(String[] labels)
This method sets the list of strings used to display weekday names.
This is an eight element
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.
setZoneStrings
public void setZoneStrings(String[][] zones)
This method sets the list of display strings for time zones.
This is a two dimensional
String
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).
DateFormatSymbols.java -- Format over a range of numbers
Copyright (C) 1998, 1999, 2000, 2001, 2003, 2005, 2006 Free Software Foundation, Inc.
This file is part of GNU Classpath.
GNU Classpath is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
GNU Classpath is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Classpath; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
02110-1301 USA.
Linking this library statically or dynamically with other modules is
making a combined work based on this library. Thus, the terms and
conditions of the GNU General Public License cover the whole
combination.
As a special exception, the copyright holders of this library give you
permission to link this library with independent modules to produce an
executable, regardless of the license terms of these independent
modules, and to copy and distribute the resulting executable under
terms of your choice, provided that you also meet, for each linked
independent module, the terms and conditions of the license of that
module. An independent module is a module which is not derived from
or based on this library. If you modify this library, you may extend
this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version.