APIdia Launch Partner
Top Description Fields Constructors Methods
sun.util.locale.provider

public Class CalendarProviderImpl

extends CalendarProvider
implements AvailableLanguageTags
Class Inheritance
All Implemented Interfaces
sun.util.locale.provider.AvailableLanguageTags
Imports
java.util.Calendar, .Locale, .Set, .TimeZone, sun.util.spi.CalendarProvider

Concrete implementation of the CalendarProvider class for the JRE LocaleProviderAdapter.
Author
Naoto Sato

Field Summary

Modifier and TypeField and Description
private final Set<String>
private final LocaleProviderAdapter.Type

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Set<String>
getAvailableLanguageTags()

Implements sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Returns a set of available language tags of a LocaleServiceProvider.

public Locale[]

Returns:

An array of all locales for which this locale service provider can provide localized objects or names.
getAvailableLocales
()

Implements abstract java.util.spi.LocaleServiceProvider.getAvailableLocales.

Returns an array of all locales for which this locale service provider can provide localized objects or names.

public Calendar

Returns:

a Calendar instance.
getInstance
(TimeZone
the time zone
zone
,
Locale
the desired locale
locale
)

Implements abstract sun.util.spi.CalendarProvider.getInstance.

Returns a new Calendar instance for the specified locale.

public boolean
isSupportedLocale(Locale locale)

Overrides java.util.spi.LocaleServiceProvider.isSupportedLocale.

Returns true if the given locale is supported by this locale service provider.

Field Detail

langtagsback to summary
private final Set<String> langtags
typeback to summary
private final LocaleProviderAdapter.Type type

Constructor Detail

CalendarProviderImplback to summary
public CalendarProviderImpl(LocaleProviderAdapter.Type type, Set<String> langtags)

Method Detail

getAvailableLanguageTagsback to summary
public Set<String> getAvailableLanguageTags()

Implements sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Doc from sun.util.locale.provider.AvailableLanguageTags.getAvailableLanguageTags.

Returns a set of available language tags of a LocaleServiceProvider. Note that the returned set doesn't contain the language tag for Locale.Root.

Annotations
@Override
getAvailableLocalesback to summary
public Locale[] getAvailableLocales()

Implements abstract java.util.spi.LocaleServiceProvider.getAvailableLocales.

Returns an array of all locales for which this locale service provider can provide localized objects or names.

Returns:Locale[]

An array of all locales for which this locale service provider can provide localized objects or names.

Annotations
@Override
getInstanceback to summary
public Calendar getInstance(TimeZone zone, Locale locale)

Implements abstract sun.util.spi.CalendarProvider.getInstance.

Returns a new Calendar instance for the specified locale.

Parameters
zone:TimeZone

the time zone

locale:Locale

the desired locale

Returns:Calendar

a Calendar instance.

Annotations
@Override
Exceptions
NullPointerException:
if locale is null
IllegalArgumentException:
if locale isn't one of the locales returned from getAvailableLocales().
See Also
java.util.Calendar#getInstance(java.util.Locale)
isSupportedLocaleback to summary
public boolean isSupportedLocale(Locale locale)

Overrides java.util.spi.LocaleServiceProvider.isSupportedLocale.

Doc from java.util.spi.LocaleServiceProvider.isSupportedLocale.

Returns true if the given locale is supported by this locale service provider. The given locale may contain extensions that should be taken into account for the support determination.

The default implementation returns true if the given locale is equal to any of the available Locales returned by getAvailableLocales() with ignoring any extensions in both the given locale and the available locales. Concrete locale service provider implementations should override this method if those implementations are Locale extensions-aware. For example, DecimalFormatSymbolsProvider implementations will need to check extensions in the given locale to see if any numbering system is specified and can be supported. However, CollatorProvider implementations may not be affected by any particular numbering systems, and in that case, extensions for numbering systems should be ignored.

Annotations
@Override