Interface FormatService

    • Method Detail

      • getQuantityFormat

        QuantityFormat getQuantityFormat()
        Returns the default quantity format. It is up to implementations what to consider a suitable default. For some (locale-sensitive) implementations it may be a quantity format based on Locale.current() while others may return getQuantityFormat("Simple") or getQuantityFormat("ISO").
        Returns:
        the default QuantityFormat implementation.
      • getQuantityFormat

        QuantityFormat getQuantityFormat​(java.lang.String name)
        Returns the quantity format having the specified name or null if none. For example (@code getQuantityFormat("Simple")} to return the simple QuantityFormat implementation.
        Parameters:
        name - the name of the format.
        Returns:
        the corresponding quantity format.
      • getUnitFormat

        UnitFormat getUnitFormat()
        Returns the default unit format. It is up to implementations what to consider a suitable default. For some (locale-sensitive) implementations it may be a unit format based on Locale.current() while others may return getUnitFormat("Simple") or getUnitFormat("ISO").
        Returns:
        the default UnitFormat implementation.
      • getUnitFormat

        UnitFormat getUnitFormat​(java.lang.String name)
        Returns the unit format having the specified name or null if none. For example getUnitFormat("Simple") to return a simple UnitFormat implementation.
        Parameters:
        name - the name of the format.
        Returns:
        the corresponding unit format.
      • getUnitFormat

        UnitFormat getUnitFormat​(java.lang.String name,
                                 java.lang.String variant)
        Returns the unit format having the specified name or null if none. For example getUnitFormat("Simple") to return a simple UnitFormat implementation.
        The variant is an arbitrary value to allow a variation of a UnitFormat, for example UTF vs. ASCII encoding of the simple UnitFormat or case sensitive vs. case insensitive UCUM format.

        If no variant is applicable, the UnitFormat matching the name only is returned.

        Parameters:
        name - the name of the format.
        variant - any arbitrary value used to indicate a variation of a UnitFormat.
        Returns:
        the corresponding unit format.