public abstract class Measure extends Object
Measure objects are parsed and formatted by subclasses of MeasureFormat.
Measure objects are immutable.
Number,
MeasureUnit,
MeasureFormat| Modifier | Constructor and Description |
|---|---|
protected |
Measure(Number number,
MeasureUnit unit)
Constructs a new object given a number and a unit.
|
| Modifier and Type | Method and 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.
|
protected 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 (c) 2012 IBM Corporation and others.