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 Details

    • TLcdISO19103Measure

      public TLcdISO19103Measure(double aValue, ILcdISO19103UnitOfMeasure aUom)
      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 interface ILcdISO19103Measure
      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 interface ILcdISO19103Measure
      Parameters:
      aValue -
      See Also:
    • getUnitOfMeasure

      public ILcdISO19103UnitOfMeasure getUnitOfMeasure()
      Description copied from interface: ILcdISO19103Measure
      Returns the unit of measure this measure is expressed in.
      Specified by:
      getUnitOfMeasure in interface ILcdISO19103Measure
    • setUnitOfMeasure

      public void setUnitOfMeasure(ILcdISO19103UnitOfMeasure aUnitOfMeasure)
      Description copied from interface: ILcdISO19103Measure
      Sets the unit of measure this measure is expressed in.
      Specified by:
      setUnitOfMeasure in interface ILcdISO19103Measure
      Parameters:
      aUnitOfMeasure -
    • convert

      public void convert(ILcdISO19103UnitOfMeasure aUnitOfMeasure, ILcdISO19103Measure aMeasureSFCT)
      Description copied from interface: ILcdISO19103Measure
      Converts this measure to another unit of measure by means of a side effect parameter.
      Specified by:
      convert in interface ILcdISO19103Measure
      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

      public int compareTo(ILcdISO19103Measure o)
      Specified by:
      compareTo in interface Comparable<ILcdISO19103Measure>
    • stringValueWithUOM

      public 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.

      Returns:
      the value represented as a String with the unit of measure attached at the end.
    • stringValue

      public 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.

      Returns:
      the value represented as a String without the unit of measure attached.
    • toString

      public String toString()
      Returns the same as stringValueWithUOM().
      Overrides:
      toString in class Object
      Returns:
      the same as stringValueWithUOM().
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • intValue

      public int intValue()
      Specified by:
      intValue in class Number
    • longValue

      public long longValue()
      Specified by:
      longValue in class Number
    • floatValue

      public float floatValue()
      Specified by:
      floatValue in class Number
    • doubleValue

      public double doubleValue()
      Specified by:
      doubleValue in class Number