com.ibm.icu.util
Class Measure

java.lang.Object
  extended bycom.ibm.icu.util.Measure
Direct Known Subclasses:
CurrencyAmount

Deprecated. This is a draft API and might change in a future release of ICU.

public abstract class Measure
extends Object

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. This is an abstract class. Subclasses specify a concrete Unit type.

Measure objects are parsed and formatted by subclasses of MeasureFormat.

Measure objects are immutable.

Author:
Alan Liu
See Also:
Number, MeasureUnit, MeasureFormat
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..

Constructor Summary
protected Measure(Number number, MeasureUnit unit)
          Deprecated. This is a draft API and might change in a future release of ICU.
 
Method Summary
 boolean equals(Object obj)
          Deprecated. This is a draft API and might change in a future release of ICU.
 Number getNumber()
          Deprecated. This is a draft API and might change in a future release of ICU.
 MeasureUnit getUnit()
          Deprecated. This is a draft API and might change in a future release of ICU.
 int hashCode()
          Deprecated. This is a draft API and might change in a future release of ICU.
 String toString()
          Deprecated. This is a draft API and might change in a future release of ICU.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Measure

protected Measure(Number number,
                  MeasureUnit unit)
Deprecated. This is a draft API and might change in a future release of ICU.

Constructs a new object given a number and a unit.

Parameters:
number - the number
unit - the unit
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..
Method Detail

equals

public boolean equals(Object obj)
Deprecated. This is a draft API and might change in a future release of ICU.

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

Returns:
true if this object is equal to the given object
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..

hashCode

public int hashCode()
Deprecated. This is a draft API and might change in a future release of ICU.

Returns a hashcode for this object.

Returns:
a 32-bit hash
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..

toString

public String toString()
Deprecated. This is a draft API and might change in a future release of ICU.

Returns a string representation of this object.

Returns:
a string representation consisting of the ISO currency code together with the numeric amount
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..

getNumber

public Number getNumber()
Deprecated. This is a draft API and might change in a future release of ICU.

Returns the numeric value of this object.

Returns:
this object's Number
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..

getUnit

public MeasureUnit getUnit()
Deprecated. This is a draft API and might change in a future release of ICU.

Returns the unit of this object.

Returns:
this object's Unit
Status:
Draft ICU 3.0.
Status:
Deprecated in This is a draft API and might change in a future release of ICU..


Copyright (c) 2004 IBM Corporation and others.