public abstract class UnitNameProvider extends LocaleServiceProvider
unit class.
Note that unit symbols are considered names when determining
behaviors described in the
LocaleServiceProvider
specification.| Modifier | Constructor | Description |
|---|---|---|
protected |
UnitNameProvider() |
Sole constructor.
|
| Modifier and Type | Method | Description |
|---|---|---|
String |
getDisplayName(String unitCode,
Locale locale) |
Returns a name for the unit that is appropriate for display to the
user.
|
abstract String |
getSymbol(String unitCode,
Locale locale) |
Gets the symbol of the given unit for the specified locale.
|
getAvailableLocales, isSupportedLocaleprotected UnitNameProvider()
public abstract String getSymbol(String unitCode, Locale locale)
unitCode - the unit code, which
consists of three upper-case letters between 'A' (U+0041) and
'Z' (U+005A)locale - the desired localeNullPointerException - if unitCode or
locale is nullIllegalArgumentException - if unitCode is not in
the form of three upper-case letters, or locale isn't
one of the locales returned from
getAvailableLocales().javax.measure.Unit#getSymbol(java.util.Locale)public String getDisplayName(String unitCode, Locale locale)
unitCode - the ISO 4217 unit, which
consists of three upper-case letters between 'A' (U+0041) and
'Z' (U+005A)locale - the desired localeIllegalArgumentException - if unitCode is not in
the form of three upper-case letters, or locale isn't
one of the locales returned from
getAvailableLocales().NullPointerException - if unitCode or
locale is nullCopyright © 2005–2023 Units of Measurement project. All rights reserved.