CurrencyAmount
, TimeUnitAmount
public 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
Constructor | Description |
---|---|
Measure(Number number,
MeasureUnit unit) |
Constructs a new object given a number and a unit.
|
Modifier and Type | Method | Description |
---|---|---|
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)
public int hashCode()
public String toString()
public Number getNumber()
public MeasureUnit getUnit()
Copyright © 2016 Unicode, Inc. and others.