Package com.luciad.util.iso19103
Class TLcdISO19103Measure
java.lang.Object
java.lang.Number
com.luciad.util.iso19103.TLcdISO19103Measure
- All Implemented Interfaces:
ILcdISO19103Measure
,Serializable
,Comparable<ILcdISO19103Measure>
- Direct Known Subclasses:
TLcdISO19103DistanceMeasure
public class TLcdISO19103Measure
extends Number
implements ILcdISO19103Measure, Comparable<ILcdISO19103Measure>
A representation of any measurement with a double value, such as a distance, a speed, etc.
It builds upon the measure concepts defined in the ISO 19103 standard: conceptual schema language for
geographic information.
It extends
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
.- See Also:
-
Constructor Summary
ConstructorDescriptionTLcdISO19103Measure
(double aValue, ILcdISO19103UnitOfMeasure aUom) Constructs a new measure with the given value and unit of measure. -
Method Summary
Modifier and TypeMethodDescriptionint
void
convert
(ILcdISO19103UnitOfMeasure aUnitOfMeasure, ILcdISO19103Measure aMeasureSFCT) Converts this measure to another unit of measure by means of a side effect parameter.double
boolean
float
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
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.Returns the value represented as a String without the unit of measure attached.Returns the value represented as a String with the unit of measure attached at the end.toString()
Returns the same asstringValueWithUOM()
.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Constructor Details
-
TLcdISO19103Measure
Constructs a new measure with the given value and unit of measure.- Parameters:
aValue
- The value.aUom
- The unit of measure.
-
-
Method Details
-
getValue
public double getValue()Description copied from interface:ILcdISO19103Measure
The numerical value of a measurement, expressed in its unit of measure.- Specified by:
getValue
in interfaceILcdISO19103Measure
- Returns:
- the numerical value of a measurement, expressed in its unit of measure.
- See Also:
-
setValue
public void setValue(double aValue) Description copied from interface:ILcdISO19103Measure
Sets the numerical value of a measurement,expressed in its unit of measure.- Specified by:
setValue
in interfaceILcdISO19103Measure
- Parameters:
aValue
-- See Also:
-
getUnitOfMeasure
Description copied from interface:ILcdISO19103Measure
Returns the unit of measure this measure is expressed in.- Specified by:
getUnitOfMeasure
in interfaceILcdISO19103Measure
-
setUnitOfMeasure
Description copied from interface:ILcdISO19103Measure
Sets the unit of measure this measure is expressed in.- Specified by:
setUnitOfMeasure
in interfaceILcdISO19103Measure
- Parameters:
aUnitOfMeasure
-
-
convert
Description copied from interface:ILcdISO19103Measure
Converts this measure to another unit of measure by means of a side effect parameter.- Specified by:
convert
in interfaceILcdISO19103Measure
- Parameters:
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.
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ILcdISO19103Measure>
-
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 examplejava.text.NumberFormat
for this purpose.- Returns:
- the value represented as a String with the unit of measure attached at the end.
-
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 examplejava.text.NumberFormat
for this purpose.- Returns:
- the value represented as a String without the unit of measure attached.
-
toString
Returns the same asstringValueWithUOM()
.- Overrides:
toString
in classObject
- Returns:
- the same as
stringValueWithUOM()
.
-
equals
-
hashCode
public int hashCode() -
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-