Measure


public class Measure
extends Object

java.lang.Object
   ↳ android.icu.util.Measure
CurrencyAmount An amount of currency, consisting of a Number and a Currency. 


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, MeasureUnit unit)

Constructs a new object given a number and a unit.

Public methods

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.

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

Measure

Added in API level 24
public Measure (Number number, 
                MeasureUnit unit)

Constructs a new object given a number and a unit.

Parameters
number Number: the number

unit MeasureUnit: the unit

Public methods

equals

Added in API level 24
public boolean equals (Object obj)

Returns true if the given object is equal to this object.

Parameters
obj Object: the reference object with which to compare.

Returns
boolean true if this object is equal to the given object

getNumber

Added in API level 24
public Number getNumber ()

Returns the numeric value of this object.

Returns
Number this object's Number

getUnit

Added in API level 24
public MeasureUnit getUnit ()

Returns the unit of this object.

Returns
MeasureUnit this object's Unit

hashCode

Added in API level 24
public int hashCode ()

Returns a hashcode for this object.

Returns
int a 32-bit hash

toString

Added in API level 24
public String toString ()

Returns a string representation of this object.

Returns
String a string representation consisting of the ISO currency code together with the numeric amount