Class TimeZoneGenericNames

    • Constructor Detail

      • TimeZoneGenericNames

        public TimeZoneGenericNames​(ULocale locale,
                                    TimeZoneNames tznames)
        Constructs a TimeZoneGenericNames with the given locale and the TimeZoneNames.
        Parameters:
        locale - the locale
        tznames - the TimeZoneNames
    • Method Detail

      • getInstance

        public static TimeZoneGenericNames getInstance​(ULocale locale)
        The factory method of TimeZoneGenericNames. This static method returns a frozen instance of cached TimeZoneGenericNames.
        Parameters:
        locale - the locale
        Returns:
        A frozen TimeZoneGenericNames.
      • getDisplayName

        public String getDisplayName​(TimeZone tz,
                                     TimeZoneGenericNames.GenericNameType type,
                                     long date)
        Returns the display name of the time zone for the given name type at the given date, or null if the display name is not available.
        Parameters:
        tz - the time zone
        type - the generic name type - see TimeZoneGenericNames.GenericNameType
        date - the date
        Returns:
        the display name of the time zone for the given name type at the given date, or null.
      • getGenericLocationName

        public String getGenericLocationName​(String canonicalTzID)
        Returns the generic location name for the given canonical time zone ID.
        Parameters:
        canonicalTzID - the canonical time zone ID
        Returns:
        the generic location name for the given canonical time zone ID.
      • setFormatPattern

        public TimeZoneGenericNames setFormatPattern​(TimeZoneGenericNames.Pattern patType,
                                                     String patStr)
        Sets the pattern string for the pattern type. Note: This method is designed for CLDR ST - not for common use.
        Parameters:
        patType - the pattern type
        patStr - the pattern string
        Returns:
        this object.