Package java.util.spi

Class TimeZoneNameProvider

java.lang.Object
java.util.spi.LocaleServiceProvider
java.util.spi.TimeZoneNameProvider

public abstract class TimeZoneNameProvider
extends LocaleServiceProvider
This abstract class should be extended by service providers that provide localized time zone names.

Note that Android does not support user-supplied locale service providers.

Since:
1.6
  • Constructor Details

    • TimeZoneNameProvider

      protected TimeZoneNameProvider()
      Default constructor, for use by subclasses.
  • Method Details

    • getDisplayName

      public abstract String getDisplayName​(String id, boolean daylight, int style, Locale locale)
      Returns the localized name for the given time zone in the given locale.
      Parameters:
      id - the time zone id
      daylight - true to return the name for daylight saving time.
      style - TimeZone.LONG or TimeZone.SHORT
      locale - the locale
      Returns:
      the readable time zone name, or null if it is unavailable
      Throws:
      NullPointerException - if id == null || locale == null
      IllegalArgumentException - if locale is not available or style is invalid