Class TLcdDistanceUnit

java.lang.Object
com.luciad.util.TLcdDistanceUnit
All Implemented Interfaces:
ILcdISO19103UnitOfMeasure, Serializable

public class TLcdDistanceUnit extends Object implements Serializable, ILcdISO19103UnitOfMeasure
This class defines distance unit constants. The standard unit is 'meter'.
See Also:
  • Field Details

  • Constructor Details

    • TLcdDistanceUnit

      public TLcdDistanceUnit(String aUnitName, String aUnitShortName, double aToMetreFactor)
      Constructs a new distance unit.
      Parameters:
      aUnitName - The name of the unit.
      aUnitShortName - The short name of the unit, typically used as the suffix after a number.
      aToMetreFactor - The factor to convert a value expressed in this unit to metres. For example, if the unit is km, the factor is 1000.
  • Method Details

    • getUnitName

      public String getUnitName()
      Returns the name of this TLcdDistanceUnit (e.g. Meter, Kilometer, Mile, etc ...).
      Returns:
      the name of this TLcdDistanceUnit (e.g. Meter, Kilometer, Mile, etc ...).
    • getUnitShortName

      public String getUnitShortName()
      Returns the short name of this TLcdDistanceUnit (e.g. m, km, mi, etc ...).
      Returns:
      the short name of this TLcdDistanceUnit (e.g. m, km, mi, etc ...).
    • getToMetreFactor

      public double getToMetreFactor()
      Returns the factor to apply to convert a distance expressed in that specific unit into a distance in meters.
      Returns:
      the factor to apply to convert a distance expressed in that specific unit into a distance in meters.
    • getAllDistanceUnits

      public static TLcdDistanceUnit[] getAllDistanceUnits()
      Returns the available distance units to consider in a JVM session.
      Returns:
      the available distance units to consider in a JVM session.
      See Also:
    • setAllDistanceUnits

      public static void setAllDistanceUnits(TLcdDistanceUnit[] aAllDistanceUnitArray)
      Sets statically all TLcdDistanceUnit to consider in a JVM session. Typically, this method should be called in the main of the application.
      Parameters:
      aAllDistanceUnitArray - the distance units to consider in a JVM session
      See Also:
    • addDistanceUnit

      public static void addDistanceUnit(TLcdDistanceUnit aDistanceUnit)
      Adds the specified distance unit to the set of distance units which are registered for this JVM session.
      Parameters:
      aDistanceUnit - a distance unit to be registered for this JVM session.
      Throws:
      IllegalArgumentException - If a distance unit with the same symbol was already registered before.
    • removeDistanceUnit

      public static void removeDistanceUnit(TLcdDistanceUnit aDistanceUnit)
      Removes the specified distance unit from the set of distance units which are registered for this JVM session.
      Parameters:
      aDistanceUnit - a distance unit to be removed for this JVM session.
      Throws:
      IllegalArgumentException - If the specified distance unit is not contained in the list of registered distance units.
    • toString

      public String toString()
      Returns the unit name.
      Overrides:
      toString in class Object
      Returns:
      the unit name.
    • getUOMName

      public String getUOMName()
      Description copied from interface: ILcdISO19103UnitOfMeasure
      The name of the unit of measure
      Specified by:
      getUOMName in interface ILcdISO19103UnitOfMeasure
      Returns:
      the name of the unit of measure
    • getUOMSymbol

      public String getUOMSymbol()
      Description copied from interface: ILcdISO19103UnitOfMeasure
      The symbol used for the unit of measure
      Specified by:
      getUOMSymbol in interface ILcdISO19103UnitOfMeasure
      Returns:
      the symbol used for the unit of measure
    • getMeasureType

      public TLcdISO19103MeasureTypeCode getMeasureType()
      Description copied from interface: ILcdISO19103UnitOfMeasure
      The type of measure this unit of measure is used for.
      Specified by:
      getMeasureType in interface ILcdISO19103UnitOfMeasure
      Returns:
      the type of measure this unit of measure is used for.
    • getNameOfStandardUnit

      public String getNameOfStandardUnit()
      Description copied from interface: ILcdISO19103UnitOfMeasure
      The name of the standard unit for this type of measures.
      Specified by:
      getNameOfStandardUnit in interface ILcdISO19103UnitOfMeasure
      Returns:
      the name of the standard unit for this type of measures.
    • convertToStandard

      public double convertToStandard(double aValue)
      Description copied from interface: ILcdISO19103UnitOfMeasure
      Converts a value which is assumed in this unit of measure to the standard unit of measure.
      Specified by:
      convertToStandard in interface ILcdISO19103UnitOfMeasure
    • convertFromStandard

      public double convertFromStandard(double aValue)
      Description copied from interface: ILcdISO19103UnitOfMeasure
      Converts a value which is assumed in the standard unit of measure to the unit of measure in the measureSFCT.
      Specified by:
      convertFromStandard in interface ILcdISO19103UnitOfMeasure
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object