com.ibm.icu.util
Class Measure
public abstract class Measure
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.
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.
|
Measure
protected Measure(Number number,
MeasureUnit unit)
Constructs a new object given a number and a unit.
number
- the numberunit
- the unit
equals
public boolean equals(Object obj)
Returns true if the given object is equal to this object.
- true if this object is equal to the given object
getNumber
public Number getNumber()
Returns the numeric value of this object.
getUnit
public MeasureUnit getUnit()
Returns the unit of this object.
hashCode
public int hashCode()
Returns a hashcode for this object.
toString
public String toString()
Returns a string representation of this object.
- a string representation consisting of the ISO currency
code together with the numeric amount
Copyright (c) 2006 IBM Corporation and others.