public class Measure
extends Object
| java.lang.Object | |
| android.icu.util.Measure | |
| |
指定单位的数量,由数字和单位组成。 例如,长度度量由数字和长度单位组成,例如英尺或米。
度量对象由MeasureFormat的子类进行分析和格式化。
度量对象是不可变的。 所有的子类都必须保证。 (但是,不鼓励子类化。)
也可以看看:
Public constructors |
|
|---|---|
Measure(Number number, MeasureUnit unit) 给定一个数字和一个单位构造一个新对象。 |
|
公共方法(Public methods) |
|
|---|---|
boolean |
equals(Object obj) 如果给定对象等于此对象,则返回true。 |
Number |
getNumber() 返回此对象的数值。 |
MeasureUnit |
getUnit() 返回此对象的单位。 |
int |
hashCode() 返回此对象的哈希码。 |
String |
toString() 返回此对象的字符串表示形式。 |
继承方法(Inherited methods) |
|
|---|---|
java.lang.Object
|
|
Measure (Number number, MeasureUnit unit)
给定一个数字和一个单位构造一个新对象。
| 参数(Parameters) | |
|---|---|
number |
Number: the number |
unit |
MeasureUnit: the unit |
boolean equals (Object obj)
如果给定对象等于此对象,则返回true。
| 参数(Parameters) | |
|---|---|
obj |
Object: the reference object with which to compare. |
| 返回(Returns) | |
|---|---|
boolean |
true if this object is equal to the given object |
Number getNumber ()
返回此对象的数值。
| 返回(Returns) | |
|---|---|
Number |
this object's Number |
MeasureUnit getUnit ()
返回此对象的单位。
| 返回(Returns) | |
|---|---|
MeasureUnit |
this object's Unit |
String toString ()
返回此对象的字符串表示形式。
| 返回(Returns) | |
|---|---|
String |
a string representation consisting of the ISO currency code together with the numeric amount |