Package com.ibm.icu.util
Class Measure
java.lang.Object
com.ibm.icu.util.Measure
- Direct Known Subclasses:
CurrencyAmount
,TimeUnitAmount
An amount of a specified unit, consisting of a Number and a Unit.
For example, a length measure consists of a Number and a length
unit, such as feet or meters.
Measure objects are parsed and formatted by subclasses of MeasureFormat.
Measure objects are immutable. All subclasses must guarantee that. (However, subclassing is discouraged.)
- Author:
- Alan Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMeasure
(Number number, MeasureUnit unit) Constructs a new object given a number and a unit. -
Method Summary
-
Constructor Details
-
Measure
Constructs a new object given a number and a unit.- Parameters:
number
- the numberunit
- the unit
-
-
Method Details
-
equals
Returns true if the given object is equal to this object. -
hashCode
public int hashCode()Returns a hashcode for this object. -
toString
Returns a string representation of this object. -
getNumber
Returns the numeric value of this object.- Returns:
- this object's Number
-
getUnit
Returns the unit of this object.- Returns:
- this object's Unit
-