APIdia Launch Partner
Top Description Fields Constructors Methods
java.text

public Class DateFormatSymbols

extends Object
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Imports
java.io.IOException, .ObjectOutputStream, .Serializable, java.lang.ref.SoftReference, java.text.spi.DateFormatSymbolsProvider, java.util.Arrays, .Locale, .Objects, .ResourceBundle, java.util.concurrent.ConcurrentHashMap, .ConcurrentMap, sun.util.locale.provider.CalendarDataUtility, .LocaleProviderAdapter, .LocaleServiceProviderPool, .ResourceBundleBasedAdapter, .TimeZoneNameUtility

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. SimpleDateFormat uses 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, DateFormatSymbols.getInstance(aLocale));
new SimpleDateFormat(aPattern, DateFormatSymbols.getInstance(aLocale));

If the locale contains "rg" (region override) Unicode extension, the symbols are overridden for the designated region.

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.

Author
Chen-Lieh Huang
Since
1.1
See Also
DateFormat, SimpleDateFormat, java.util.SimpleTimeZone

Field Summary

Modifier and TypeField and Description
pack-priv String[]
ampms

AM and PM strings.

pack-priv transient volatile int
cachedHashCode

Cached hash code

private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>>
cachedInstances

Cache to hold DateFormatSymbols instances per Locale.

pack-priv String[]
eras

Era strings.

pack-priv transient boolean
isZoneStringsSet

Indicates that zoneStrings is set externally with setZoneStrings() method.

private transient int
pack-priv Locale
locale

The locale which is used for initializing this DateFormatSymbols object.

pack-priv String
localPatternChars

Localized date-time pattern characters.

pack-priv String[]
months

Month strings.

pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final String
patternChars

Unlocalized date-time pattern characters.

pack-priv static final long
pack-priv String[]
shortMonths

Short month strings.

pack-priv String[]
shortWeekdays

Short weekday strings.

pack-priv String[]
weekdays

Weekday strings.

pack-priv String[][]
zoneStrings

Localized names of time zones in this locale.

Constructor Summary

AccessConstructor and Description
public
DateFormatSymbols()

Construct a DateFormatSymbols object by loading format data from resources for the default FORMAT locale.

public
DateFormatSymbols(Locale
the desired locale
locale
)

Construct a DateFormatSymbols object by loading format data from resources for the given locale.

private
DateFormatSymbols(boolean flag)

Constructs an uninitialized DateFormatSymbols.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Overrides Cloneable

private void
copyMembers(DateFormatSymbols
the source DateFormatSymbols.
src
,
DateFormatSymbols
the target DateFormatSymbols.
dst
)

Clones all the data members from the source DateFormatSymbols to the target DateFormatSymbols.

public boolean

Returns:

true if the specified object is equal to this DateFormatSymbols
equals
(Object
object to be compared for equality
obj
)

Overrides java.lang.Object.equals.

Compares the specified object with this DateFormatSymbols for equality.

public String[]

Returns:

the ampm strings.
getAmPmStrings
()

Gets ampm strings.

public static Locale[]

Returns:

An array of locales for which localized DateFormatSymbols instances are available.
getAvailableLocales
()

Returns an array of all locales for which the getInstance methods of this class can return localized instances.

public String[]

Returns:

the era strings.
getEras
()

Gets era strings.

public static final DateFormatSymbols

Returns:

a DateFormatSymbols instance.
getInstance
()

Gets the DateFormatSymbols instance for the default locale.

public static final DateFormatSymbols

Returns:

a DateFormatSymbols instance.
getInstance
(Locale
the given locale.
locale
)

Gets the DateFormatSymbols instance for the specified locale.

public String

Returns:

the localized date-time pattern characters.
getLocalPatternChars
()

Gets localized date-time pattern characters.

public String[]

Returns:

the month strings.
getMonths
()

Gets month strings.

private static DateFormatSymbols
public String[]

Returns:

the short month strings.
getShortMonths
()

Gets short month strings.

public String[]

Returns:

the short weekday strings. Use Calendar.SUNDAY, Calendar.MONDAY, etc. to index the result array.
getShortWeekdays
()

Gets short weekday strings.

public String[]

Returns:

the weekday strings. Use Calendar.SUNDAY, Calendar.MONDAY, etc. to index the result array.
getWeekdays
()

Gets weekday strings.

pack-priv final int

Returns:

the index of the given time zone ID. Returns -1 if the given time zone ID can't be located in the DateFormatSymbols object.
getZoneIndex
(String
the given time zone ID.
ID
)

Package private: used by SimpleDateFormat Gets the index for the given time zone ID to obtain the time zone strings for formatting.

public String[][]

Returns:

the time zone strings.
getZoneStrings
()

Gets time zone strings.

private String[][]
getZoneStringsImpl(boolean needsCopy)

pack-priv final String[][]
getZoneStringsWrapper()

Wrapper method to the getZoneStrings(), which is called from inside the java.text package and not to mutate the returned arrays, so that it does not need to create a defensive copy.

public int

Returns:

the hash code for this DateFormatSymbols
hashCode
()

Overrides java.lang.Object.hashCode.

Returns the hash code for this DateFormatSymbols.

private void
initializeData(Locale locale)

Initializes this DateFormatSymbols with the locale data.

private boolean
public void
setAmPmStrings(String[]
the new ampm strings.
newAmpms
)

Sets ampm strings.

public void
setEras(String[]
the new era strings.
newEras
)

Sets era strings.

public void
setLocalPatternChars(String
the new localized date-time pattern characters.
newLocalPatternChars
)

Sets localized date-time pattern characters.

public void
setMonths(String[]
the new month strings. The array should be indexed by Calendar.JANUARY, Calendar.FEBRUARY, etc.
newMonths
)

Sets month strings.

public void
setShortMonths(String[]
the new short month strings. The array should be indexed by Calendar.JANUARY, Calendar.FEBRUARY, etc.
newShortMonths
)

Sets short month strings.

public void
setShortWeekdays(String[]
the new short weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.
newShortWeekdays
)

Sets short weekday strings.

public void
setWeekdays(String[]
the new weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.
newWeekdays
)

Sets weekday strings.

public void
setZoneStrings(String[][]
the new time zone strings.
newZoneStrings
)

Sets time zone strings.

private static String[]
private void
writeObject(ObjectOutputStream stream)

Write out the default serializable data, after ensuring the zoneStrings field is initialized in order to make sure the backward compatibility.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

ampmsback to summary
pack-priv String[] ampms

AM and PM strings. For example: "AM" and "PM". An array of 2 strings, indexed by Calendar.AM and Calendar.PM.

cachedHashCodeback to summary
pack-priv transient volatile int cachedHashCode

Cached hash code

cachedInstancesback to summary
private static final ConcurrentMap<Locale, SoftReference<DateFormatSymbols>> cachedInstances

Cache to hold DateFormatSymbols instances per Locale.

erasback to summary
pack-priv String[] eras

Era strings. For example: "AD" and "BC". An array of 2 strings, indexed by Calendar.BC and Calendar.AD.

isZoneStringsSetback to summary
pack-priv transient boolean isZoneStringsSet

Indicates that zoneStrings is set externally with setZoneStrings() method.

lastZoneIndexback to summary
private transient int lastZoneIndex
localeback to summary
pack-priv Locale locale

The locale which is used for initializing this DateFormatSymbols object.

Since
1.6
localPatternCharsback to summary
pack-priv String localPatternChars

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.

monthsback to summary
pack-priv String[] months

Month strings. For example: "January", "February", etc. An array of 13 strings (some calendars have 13 months), indexed by Calendar.JANUARY, Calendar.FEBRUARY, etc.

PATTERN_AM_PMback to summary
pack-priv static final int PATTERN_AM_PM
PATTERN_DAY_OF_MONTHback to summary
pack-priv static final int PATTERN_DAY_OF_MONTH
PATTERN_DAY_OF_WEEKback to summary
pack-priv static final int PATTERN_DAY_OF_WEEK
PATTERN_DAY_OF_WEEK_IN_MONTHback to summary
pack-priv static final int PATTERN_DAY_OF_WEEK_IN_MONTH
PATTERN_DAY_OF_YEARback to summary
pack-priv static final int PATTERN_DAY_OF_YEAR
PATTERN_ERAback to summary
pack-priv static final int PATTERN_ERA
PATTERN_HOUR0back to summary
pack-priv static final int PATTERN_HOUR0
PATTERN_HOUR1back to summary
pack-priv static final int PATTERN_HOUR1
PATTERN_HOUR_OF_DAY0back to summary
pack-priv static final int PATTERN_HOUR_OF_DAY0
PATTERN_HOUR_OF_DAY1back to summary
pack-priv static final int PATTERN_HOUR_OF_DAY1
PATTERN_ISO_DAY_OF_WEEKback to summary
pack-priv static final int PATTERN_ISO_DAY_OF_WEEK
PATTERN_ISO_ZONEback to summary
pack-priv static final int PATTERN_ISO_ZONE
PATTERN_MILLISECONDback to summary
pack-priv static final int PATTERN_MILLISECOND
PATTERN_MINUTEback to summary
pack-priv static final int PATTERN_MINUTE
PATTERN_MONTHback to summary
pack-priv static final int PATTERN_MONTH
PATTERN_MONTH_STANDALONEback to summary
pack-priv static final int PATTERN_MONTH_STANDALONE
PATTERN_SECONDback to summary
pack-priv static final int PATTERN_SECOND
PATTERN_WEEK_OF_MONTHback to summary
pack-priv static final int PATTERN_WEEK_OF_MONTH
PATTERN_WEEK_OF_YEARback to summary
pack-priv static final int PATTERN_WEEK_OF_YEAR
PATTERN_WEEK_YEARback to summary
pack-priv static final int PATTERN_WEEK_YEAR
PATTERN_YEARback to summary
pack-priv static final int PATTERN_YEAR
PATTERN_ZONE_NAMEback to summary
pack-priv static final int PATTERN_ZONE_NAME
PATTERN_ZONE_VALUEback to summary
pack-priv static final int PATTERN_ZONE_VALUE
patternCharsback to summary
pack-priv static final String patternChars

Unlocalized date-time pattern characters. For example: 'y', 'd', etc. All locales use the same these unlocalized pattern characters.

serialVersionUIDback to summary
pack-priv static final long serialVersionUID
Annotations
@Serial
shortMonthsback to summary
pack-priv String[] shortMonths

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.

shortWeekdaysback to summary
pack-priv String[] shortWeekdays

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.

weekdaysback to summary
pack-priv String[] weekdays

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.

zoneStringsback to summary
pack-priv String[][] zoneStrings

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 saving time
  • zoneStrings[i][4] - short name of zone in daylight saving time
The zone ID is not localized; it's one of the valid IDs of the TimeZone class that are not custom IDs. All other entries are localized names.
See Also
java.util.TimeZone

Constructor Detail

DateFormatSymbolsback to summary
public DateFormatSymbols()

Construct a DateFormatSymbols object by loading format data from resources for the default FORMAT locale. This constructor can only construct instances for the locales supported by the Java runtime environment, not for those supported by installed DateFormatSymbolsProvider implementations. For full locale coverage, use the getInstance method.

This is equivalent to calling DateFormatSymbols(Locale.getDefault(Locale.Category.FORMAT)).

Exceptions
MissingResourceException:
if the resources for the default locale cannot be found or cannot be loaded.
See Also
getInstance(), java.util.Locale#getDefault(java.util.Locale.Category), java.util.Locale.Category#FORMAT
DateFormatSymbolsback to summary
public DateFormatSymbols(Locale locale)

Construct a DateFormatSymbols object by loading format data from resources for the given locale. This constructor can only construct instances for the locales supported by the Java runtime environment, not for those supported by installed DateFormatSymbolsProvider implementations. For full locale coverage, use the getInstance method.

Parameters
locale:Locale

the desired locale

Exceptions
MissingResourceException:
if the resources for the specified locale cannot be found or cannot be loaded.
NullPointerException:
if locale is null
See Also
getInstance(Locale)
DateFormatSymbolsback to summary
private DateFormatSymbols(boolean flag)

Constructs an uninitialized DateFormatSymbols.

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Overrides Cloneable

copyMembersback to summary
private void copyMembers(DateFormatSymbols src, DateFormatSymbols dst)

Clones all the data members from the source DateFormatSymbols to the target DateFormatSymbols.

Parameters
src:DateFormatSymbols

the source DateFormatSymbols.

dst:DateFormatSymbols

the target DateFormatSymbols.

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares the specified object with this DateFormatSymbols for equality. Returns true if the object is also a DateFormatSymbols and the two DateFormatSymbols objects represent the same date-time formatting data.

Implementation Specification

This method performs an equality check with a notion of class identity based on getClass(), rather than instanceof. Therefore, in the equals methods in subclasses, no instance of this class should compare as equal to an instance of a subclass.

Parameters
obj:Object

object to be compared for equality

Returns:boolean

true if the specified object is equal to this DateFormatSymbols

Annotations
@Override
See Also
Object#equals(Object)
getAmPmStringsback to summary
public String[] getAmPmStrings()

Gets ampm strings. For example: "AM" and "PM".

Returns:String[]

the ampm strings.

getAvailableLocalesback to summary
public static Locale[] getAvailableLocales()

Returns an array of all locales for which the getInstance methods of this class can return localized instances. The returned array represents the union of locales supported by the Java runtime and by installed DateFormatSymbolsProvider implementations. At a minimum, the returned array must contain a Locale instance equal to Locale.ROOT and a Locale instance equal to Locale.US.

Returns:Locale[]

An array of locales for which localized DateFormatSymbols instances are available.

Since
1.6
getErasback to summary
public String[] getEras()

Gets era strings. For example: "AD" and "BC".

Returns:String[]

the era strings.

getInstanceback to summary
public static final DateFormatSymbols getInstance()

Gets the DateFormatSymbols instance for the default locale. This method provides access to DateFormatSymbols instances for locales supported by the Java runtime itself as well as for those supported by installed DateFormatSymbolsProvider implementations.

This is equivalent to calling getInstance(Locale.getDefault(Locale.Category.FORMAT)).

Returns:DateFormatSymbols

a DateFormatSymbols instance.

Since
1.6
See Also
java.util.Locale#getDefault(java.util.Locale.Category), java.util.Locale.Category#FORMAT
getInstanceback to summary
public static final DateFormatSymbols getInstance(Locale locale)

Gets the DateFormatSymbols instance for the specified locale. This method provides access to DateFormatSymbols instances for locales supported by the Java runtime itself as well as for those supported by installed DateFormatSymbolsProvider implementations.

Parameters
locale:Locale

the given locale.

Returns:DateFormatSymbols

a DateFormatSymbols instance.

Exceptions
NullPointerException:
if locale is null
Since
1.6
getLocalPatternCharsback to summary
public String getLocalPatternChars()

Gets localized date-time pattern characters. For example: 'u', 't', etc.

Returns:String

the localized date-time pattern characters.

getMonthsback to summary
public String[] getMonths()

Gets month strings. For example: "January", "February", etc. An array with either 12 or 13 elements will be returned depending on whether or not Calendar.UNDECIMBER is supported. Use Calendar.JANUARY, Calendar.FEBRUARY, etc. to index the result array.

If the language requires different forms for formatting and stand-alone usages, this method returns month names in the formatting form. For example, the preferred month name for January in the Czech language is ledna in the formatting form, while it is leden in the stand-alone form. This method returns "ledna" in this case. Refer to the Calendar Elements in the Unicode Locale Data Markup Language (LDML) specification for more details.

Implementation Specification

This method returns 13 elements since Calendar.UNDECIMBER is supported.

Returns:String[]

the month strings.

External Specification
https://www.unicode.org/reports/tr35
getProviderInstanceback to summary
private static DateFormatSymbols getProviderInstance(Locale locale)
getShortMonthsback to summary
public String[] getShortMonths()

Gets short month strings. For example: "Jan", "Feb", etc. An array with either 12 or 13 elements will be returned depending on whether or not Calendar.UNDECIMBER is supported. Use Calendar.JANUARY, Calendar.FEBRUARY, etc. to index the result array.

If the language requires different forms for formatting and stand-alone usages, this method returns short month names in the formatting form. For example, the preferred abbreviation for January in the Catalan language is de gen. in the formatting form, while it is gen. in the stand-alone form. This method returns "de gen." in this case. Refer to the Calendar Elements in the Unicode Locale Data Markup Language (LDML) specification for more details.

Implementation Specification

This method returns 13 elements since Calendar.UNDECIMBER is supported.

Returns:String[]

the short month strings.

External Specification
https://www.unicode.org/reports/tr35
getShortWeekdaysback to summary
public String[] getShortWeekdays()

Gets short weekday strings. For example: "Sun", "Mon", etc.

Returns:String[]

the short weekday strings. Use Calendar.SUNDAY, Calendar.MONDAY, etc. to index the result array.

getWeekdaysback to summary
public String[] getWeekdays()

Gets weekday strings. For example: "Sunday", "Monday", etc.

Returns:String[]

the weekday strings. Use Calendar.SUNDAY, Calendar.MONDAY, etc. to index the result array.

getZoneIndexback to summary
pack-priv final int getZoneIndex(String ID)

Package private: used by SimpleDateFormat Gets the index for the given time zone ID to obtain the time zone strings for formatting. The time zone ID is just for programmatic lookup. NOT LOCALIZED!!!

Parameters
ID:String

the given time zone ID.

Returns:int

the index of the given time zone ID. Returns -1 if the given time zone ID can't be located in the DateFormatSymbols object.

See Also
java.util.SimpleTimeZone
getZoneStringsback to summary
public String[][] getZoneStrings()

Gets time zone strings. Use of this method is discouraged; use TimeZone.getDisplayName() instead.

The value returned 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 saving time
  • zoneStrings[i][4] - short name of zone in daylight saving time
The zone ID is not localized; it's one of the valid IDs of the TimeZone class that are not custom IDs. All other entries are localized names. If a zone does not implement daylight saving time, the daylight saving time names should not be used.

If setZoneStrings has been called on this DateFormatSymbols instance, then the strings provided by that call are returned. Otherwise, the returned array contains names provided by the Java runtime and by installed TimeZoneNameProvider implementations.

Returns:String[][]

the time zone strings.

See Also
setZoneStrings(String[][])
getZoneStringsImplback to summary
private String[][] getZoneStringsImpl(boolean needsCopy)
getZoneStringsWrapperback to summary
pack-priv final String[][] getZoneStringsWrapper()

Wrapper method to the getZoneStrings(), which is called from inside the java.text package and not to mutate the returned arrays, so that it does not need to create a defensive copy.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns the hash code for this DateFormatSymbols.

Implementation Specification

Non-transient instance fields of this class are used to calculate a hash code value which adheres to the contract defined in Objects#hashCode.

Returns:int

the hash code for this DateFormatSymbols

Annotations
@Override
See Also
Object#hashCode()
initializeDataback to summary
private void initializeData(Locale locale)

Initializes this DateFormatSymbols with the locale data. This method uses a cached DateFormatSymbols instance for the given locale if available. If there's no cached one, this method creates an uninitialized instance and populates its fields from the resource bundle for the locale, and caches the instance.

Note

zoneStrings isn't initialized in this method.

isSubclassObjectback to summary
private boolean isSubclassObject()
setAmPmStringsback to summary
public void setAmPmStrings(String[] newAmpms)

Sets ampm strings. For example: "AM" and "PM".

Parameters
newAmpms:String[]

the new ampm strings.

setErasback to summary
public void setEras(String[] newEras)

Sets era strings. For example: "AD" and "BC".

Parameters
newEras:String[]

the new era strings.

setLocalPatternCharsback to summary
public void setLocalPatternChars(String newLocalPatternChars)

Sets localized date-time pattern characters. For example: 'u', 't', etc.

Parameters
newLocalPatternChars:String

the new localized date-time pattern characters.

setMonthsback to summary
public void setMonths(String[] newMonths)

Sets month strings. For example: "January", "February", etc.

Parameters
newMonths:String[]

the new month strings. The array should be indexed by Calendar.JANUARY, Calendar.FEBRUARY, etc.

setShortMonthsback to summary
public void setShortMonths(String[] newShortMonths)

Sets short month strings. For example: "Jan", "Feb", etc.

Parameters
newShortMonths:String[]

the new short month strings. The array should be indexed by Calendar.JANUARY, Calendar.FEBRUARY, etc.

setShortWeekdaysback to summary
public void setShortWeekdays(String[] newShortWeekdays)

Sets short weekday strings. For example: "Sun", "Mon", etc.

Parameters
newShortWeekdays:String[]

the new short weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.

setWeekdaysback to summary
public void setWeekdays(String[] newWeekdays)

Sets weekday strings. For example: "Sunday", "Monday", etc.

Parameters
newWeekdays:String[]

the new weekday strings. The array should be indexed by Calendar.SUNDAY, Calendar.MONDAY, etc.

setZoneStringsback to summary
public void setZoneStrings(String[][] newZoneStrings)

Sets time zone strings. The argument must be 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 saving time
  • zoneStrings[i][4] - short name of zone in daylight saving time
The zone ID is not localized; it's one of the valid IDs of the TimeZone class that are not custom IDs. All other entries are localized names.
Parameters
newZoneStrings:String[][]

the new time zone strings.

Exceptions
IllegalArgumentException:
if the length of any row in newZoneStrings is less than 5
NullPointerException:
if newZoneStrings is null
See Also
getZoneStrings()
toOneBasedArrayback to summary
private static String[] toOneBasedArray(String[] src)
writeObjectback to summary
private void writeObject(ObjectOutputStream stream) throws IOException

Write out the default serializable data, after ensuring the zoneStrings field is initialized in order to make sure the backward compatibility.

Annotations
@Serial
Since
1.6