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
ConstructorsConstructorDescriptionTLcdISO19103Measure(double aValue, ILcdISO19103UnitOfMeasure aUom) Constructs a new measure with the given value and unit of measure. -
Method Summary
Modifier and TypeMethodDescriptionintvoidconvert(ILcdISO19103UnitOfMeasure aUnitOfMeasure, ILcdISO19103Measure aMeasureSFCT) Converts this measure to another unit of measure by means of a side effect parameter.doublebooleanfloatReturns the unit of measure this measure is expressed in.doublegetValue()The numerical value of a measurement, expressed in its unit of measure.inthashCode()intintValue()longvoidsetUnitOfMeasure(ILcdISO19103UnitOfMeasure aUnitOfMeasure) Sets the unit of measure this measure is expressed in.voidsetValue(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:ILcdISO19103MeasureThe numerical value of a measurement, expressed in its unit of measure.- Specified by:
getValuein 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:ILcdISO19103MeasureSets the numerical value of a measurement,expressed in its unit of measure.- Specified by:
setValuein interfaceILcdISO19103Measure- Parameters:
aValue-- See Also:
-
getUnitOfMeasure
Description copied from interface:ILcdISO19103MeasureReturns the unit of measure this measure is expressed in.- Specified by:
getUnitOfMeasurein interfaceILcdISO19103Measure
-
setUnitOfMeasure
Description copied from interface:ILcdISO19103MeasureSets the unit of measure this measure is expressed in.- Specified by:
setUnitOfMeasurein interfaceILcdISO19103Measure- Parameters:
aUnitOfMeasure-
-
convert
Description copied from interface:ILcdISO19103MeasureConverts this measure to another unit of measure by means of a side effect parameter.- Specified by:
convertin 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:
compareToin 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.NumberFormatfor 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.NumberFormatfor this purpose.- Returns:
- the value represented as a String without the unit of measure attached.
-
toString
Returns the same asstringValueWithUOM().- Overrides:
toStringin 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:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-