Package javax.measure
Class MeasureFormat
java.lang.Object
java.text.Format
javax.measure.MeasureFormat
- All Implemented Interfaces:
Serializable
,Cloneable
This class provides the interface for formatting and parsing measures
.
As a minimum, instances of this class should be able to parse/format
measure using CompoundUnit
.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.text.Format
Format.Field
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic MeasureFormat
Returns the measure format for the default locale.static MeasureFormat
getInstance
(NumberFormat numberFormat, UnitFormat unitFormat) Returns the measure format using the specified number format and unit format (the number and unit are separated by a space).Methods inherited from class java.text.Format
clone, format, format, formatToCharacterIterator, parseObject, parseObject
-
Constructor Details
-
MeasureFormat
public MeasureFormat()
-
-
Method Details
-
getInstance
Returns the measure format for the default locale.- Returns:
getInstance(Number.getInstance(), Unit.getInstance())
-
getInstance
Returns the measure format using the specified number format and unit format (the number and unit are separated by a space).- Parameters:
numberFormat
- the number format.unitFormat
- the unit format.- Returns:
- the corresponding format.
-