Class UFormat

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  UFormat.SpanField
      A field that represents a span of text that may be composed with other fields.
      • Nested classes/interfaces inherited from class java.text.Format

        java.text.Format.Field
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private ULocale actualLocale
      The locale containing data used to construct this object, or null.
      private static long serialVersionUID  
      private ULocale validLocale
      The most specific locale containing any resource data, or null.
    • Constructor Summary

      Constructors 
      Constructor Description
      UFormat()
      Default constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      ULocale getLocale​(ULocale.Type type)
      Return the locale that was used to create this object, or null.
      (package private) void setLocale​(ULocale valid, ULocale actual)
      Set information about the locales that were used to create this object.
      • Methods inherited from class java.text.Format

        clone, format, format, formatToCharacterIterator, parseObject, parseObject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • validLocale

        private ULocale validLocale
        The most specific locale containing any resource data, or null.
        See Also:
        ULocale
      • actualLocale

        private ULocale actualLocale
        The locale containing data used to construct this object, or null.
        See Also:
        ULocale
    • Constructor Detail

      • UFormat

        public UFormat()
        Default constructor.
    • Method Detail

      • getLocale

        public final ULocale getLocale​(ULocale.Type type)
        Return the locale that was used to create this object, or null. This may may differ from the locale requested at the time of this object's creation. For example, if an object is created for locale en_US_CALIFORNIA, the actual data may be drawn from en (the actual locale), and en_US may be the most specific locale that exists (the valid locale).

        Note: This method will be implemented in ICU 3.0; ICU 2.8 contains a partial preview implementation. The actual locale is returned correctly, but the valid locale is not, in most cases.

        Parameters:
        type - type of information requested, either ULocale.VALID_LOCALE or ULocale.ACTUAL_LOCALE.
        Returns:
        the information specified by type, or null if this object was not constructed from locale data.
        See Also:
        ULocale, ULocale.VALID_LOCALE, ULocale.ACTUAL_LOCALE
      • setLocale

        final void setLocale​(ULocale valid,
                             ULocale actual)
        Set information about the locales that were used to create this object. If the object was not constructed from locale data, both arguments should be set to null. Otherwise, neither should be null. The actual locale must be at the same level or less specific than the valid locale. This method is intended for use by factories or other entities that create objects of this class.
        Parameters:
        valid - the most specific locale containing any resource data, or null
        actual - the locale containing data used to construct this object, or null
        See Also:
        ULocale, ULocale.VALID_LOCALE, ULocale.ACTUAL_LOCALE