public class TLcdISO19103Measure extends Number implements ILcdISO19103Measure, Comparable<ILcdISO19103Measure>
java.lang.Number
, so it can easily be formatted
using for example a java.text.NumberFormat
. The methods
stringValue()
and stringValueWithUOM()
are available for basic
formatting.
It implements comparable so that measurements can easily be sorted; units of measure are taken
into account. If measurements from different types (e.g. speed vs. distance) are compared, they
are compared on the name of their TLcdISO19103MeasureTypeCode
.Constructor and Description |
---|
TLcdISO19103Measure(double aValue,
ILcdISO19103UnitOfMeasure aUom)
Constructs a new measure with the given value and unit of measure.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(ILcdISO19103Measure o) |
void |
convert(ILcdISO19103UnitOfMeasure aUnitOfMeasure,
ILcdISO19103Measure aMeasureSFCT)
Converts this measure to another unit of measure by means of a side effect parameter.
|
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
ILcdISO19103UnitOfMeasure |
getUnitOfMeasure()
Returns the unit of measure this measure is expressed in.
|
double |
getValue()
The numerical value of a measurement, expressed in its unit of measure.
|
int |
hashCode() |
int |
intValue() |
long |
longValue() |
void |
setUnitOfMeasure(ILcdISO19103UnitOfMeasure aUnitOfMeasure)
Sets the unit of measure this measure is expressed in.
|
void |
setValue(double aValue)
Sets the numerical value of a measurement,expressed in its unit of measure.
|
String |
stringValue()
Returns the value represented as a String without the unit of measure attached.
Please note that this method does not respect locales or custom
formatting, please use for example
java.text.NumberFormat for
this purpose. |
String |
stringValueWithUOM()
Returns the value represented as a String with the unit of measure
attached at the end.
Please note that this method does not respect locales or custom
formatting, please use for example
java.text.NumberFormat for
this purpose. |
String |
toString()
Returns the same as
stringValueWithUOM() . |
byteValue, shortValue
public TLcdISO19103Measure(double aValue, ILcdISO19103UnitOfMeasure aUom)
aValue
- The value.aUom
- The unit of measure.public double getValue()
ILcdISO19103Measure
getValue
in interface ILcdISO19103Measure
ILcdISO19103Measure.setValue(double)
public void setValue(double aValue)
ILcdISO19103Measure
setValue
in interface ILcdISO19103Measure
ILcdISO19103Measure.getValue()
public ILcdISO19103UnitOfMeasure getUnitOfMeasure()
ILcdISO19103Measure
getUnitOfMeasure
in interface ILcdISO19103Measure
public void setUnitOfMeasure(ILcdISO19103UnitOfMeasure aUnitOfMeasure)
ILcdISO19103Measure
setUnitOfMeasure
in interface ILcdISO19103Measure
public void convert(ILcdISO19103UnitOfMeasure aUnitOfMeasure, ILcdISO19103Measure aMeasureSFCT)
ILcdISO19103Measure
convert
in interface ILcdISO19103Measure
aUnitOfMeasure
- the unit of measure to express the value in.aMeasureSFCT
- the measure which will contain the new value and the unit of measure passed.public int compareTo(ILcdISO19103Measure o)
compareTo
in interface Comparable<ILcdISO19103Measure>
public String stringValueWithUOM()
java.text.NumberFormat
for
this purpose.public String stringValue()
java.text.NumberFormat
for
this purpose.public String toString()
stringValueWithUOM()
.toString
in class Object
stringValueWithUOM()
.public float floatValue()
floatValue
in class Number
public double doubleValue()
doubleValue
in class Number