Package javax.measure.spi
Interface UnitFormatService
-
public interface UnitFormatService
This interface represent the service to obtainUnitFormat
instances.- Since:
- 1.0
- Version:
- 1.0, August 8, 2016
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Set<java.lang.String>
getAvailableFormatNames()
Gets a list with available format names for this format service.UnitFormat
getUnitFormat()
Returns the default unit format.UnitFormat
getUnitFormat(java.lang.String name)
Returns the unit format having the specified name ornull
if none.
-
-
-
Method Detail
-
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 onLocale.current()
while others may returngetUnitFormat("Simple")
orgetUnitFormat("ISO")
- Returns:
- the default
UnitFormat
implementation.
-
getUnitFormat
UnitFormat getUnitFormat(java.lang.String name)
Returns the unit format having the specified name ornull
if none. For examplegetUnitFormat("UCUM")
to return a UCUM specificUnitFormat
implementation.- Parameters:
name
- the name of the format.- Returns:
- the corresponding unit format.
-
getAvailableFormatNames
java.util.Set<java.lang.String> getAvailableFormatNames()
Gets a list with available format names for this format service.- Returns:
- list of available formats, never null.
-
-