Measure objects are parsed and formatted by subclasses of MeasureFormat.
Measure objects are immutable. All subclasses must guarantee that. (However, subclassing is discouraged.)
java.lang.Number , com.ibm.icu.util.MeasureUnit , com.ibm.icu.text.MeasureFormat
| Modifier and Type | Field and Description |
|---|---|
| private final Number | |
| private final MeasureUnit |
| Access | Constructor and Description |
|---|---|
| public | Measure(Number
the number number, MeasureUnit the unit unit)Constructs a new object given a number and a unit. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if this object is equal to the given objectthe reference object with which to compare. obj)Overrides java. |
| public Number | |
| public MeasureUnit | |
| public int | Returns: a 32-bit hashOverrides java. |
| private static boolean | |
| public String | Returns: a string representation consisting of the ISO currency code together with the numeric amountOverrides java. |
| number | back to summary |
|---|---|
| private final Number number | |
| unit | back to summary |
|---|---|
| private final MeasureUnit unit | |
| Measure | back to summary |
|---|---|
| public Measure(Number number, MeasureUnit unit) Constructs a new object given a number and a unit.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Returns true if the given object is equal to this object.
| |
| getNumber | back to summary |
|---|---|
| public Number getNumber() Returns the numeric value of this object. | |
| getUnit | back to summary |
|---|---|
| public MeasureUnit getUnit() Returns the unit of this object.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Returns a hashcode for this object. | |
| numbersEqual | back to summary |
|---|---|
| private static boolean numbersEqual(Number a, Number b) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation of this object. | |