CurrencyAmountpublic class Measure extends Object
Measure objects are parsed and formatted by subclasses of MeasureFormat.
Measure objects are immutable. All subclasses must guarantee that. (However, subclassing is discouraged.)
Number,
MeasureUnit,
MeasureFormat| 构造器 | 说明 |
|---|---|
Measure(Number number,
MeasureUnit unit) |
Constructs a new object given a number and a unit.
|
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
boolean |
equals(Object obj) |
Returns true if the given object is equal to this object.
|
Number |
getNumber() |
Returns the numeric value of this object.
|
MeasureUnit |
getUnit() |
Returns the unit of this object.
|
int |
hashCode() |
Returns a hashcode for this object.
|
String |
toString() |
Returns a string representation of this object.
|
public Measure(Number number, MeasureUnit unit)
number - the numberunit - the unitpublic boolean equals(Object obj)
equals 在类中 Objectobj - the reference object with which to compare.Object.hashCode(),
HashMappublic int hashCode()
hashCode 在类中 ObjectObject.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)public String toString()
public Number getNumber()
public MeasureUnit getUnit()