Measure
open class Measure
kotlin.Any | |
↳ | android.icu.util.Measure |
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.)
Summary
Public constructors | |
---|---|
Measure(number: Number!, unit: MeasureUnit!) Constructs a new object given a number and a unit. |
Public methods | |
---|---|
open Boolean |
Returns true if the given object is equal to this object. |
open Number! |
Returns the numeric value of this object. |
open MeasureUnit! |
getUnit() Returns the unit of this object. |
open Int |
hashCode() Returns a hashcode for this object. |
open String |
toString() Returns a string representation of this object. |
Public constructors
Measure
Measure(
number: Number!,
unit: MeasureUnit!)
Constructs a new object given a number and a unit.
Parameters | |
---|---|
number |
Number!: the number |
unit |
MeasureUnit!: the unit |
Public methods
equals
open fun equals(other: Any?): Boolean
Returns true if the given object is equal to this object.
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is equal to the given object |
getNumber
open fun getNumber(): Number!
Returns the numeric value of this object.
Return | |
---|---|
Number! |
this object's Number |
getUnit
open fun getUnit(): MeasureUnit!
Returns the unit of this object.
Return | |
---|---|
MeasureUnit! |
this object's Unit |
hashCode
open fun hashCode(): Int
Returns a hashcode for this object.
Return | |
---|---|
Int |
a 32-bit hash |
toString
open fun toString(): String
Returns a string representation of this object.
Return | |
---|---|
String |
a string representation consisting of the ISO currency code together with the numeric amount |