Package com.luciad.util
Class TLcdDistanceUnit
java.lang.Object
com.luciad.util.TLcdDistanceUnit
- All Implemented Interfaces:
ILcdISO19103UnitOfMeasure,Serializable
This class defines distance unit constants. The standard unit
is 'meter'.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TLcdDistanceUnitDistance unit for feet.static final TLcdDistanceUnitDistance unit for kilometers.static final TLcdDistanceUnitDistance unit for meters.static final TLcdDistanceUnitDistance unit for miles (US).static final TLcdDistanceUnitDistance unit for nautical miles. -
Constructor Summary
ConstructorsConstructorDescriptionTLcdDistanceUnit(String aUnitName, String aUnitShortName, double aToMetreFactor) Constructs a new distance unit. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddDistanceUnit(TLcdDistanceUnit aDistanceUnit) Adds the specified distance unit to the set of distance units which are registered for this JVM session.doubleconvertFromStandard(double aValue) Converts a value which is assumed in the standard unit of measure to the unit of measure in the measureSFCT.doubleconvertToStandard(double aValue) Converts a value which is assumed in this unit of measure to the standard unit of measure.booleanstatic TLcdDistanceUnit[]Returns the available distance units to consider in a JVM session.The type of measure this unit of measure is used for.The name of the standard unit for this type of measures.doubleReturns the factor to apply to convert a distance expressed in that specific unit into a distance in meters.Returns the name of thisTLcdDistanceUnit(e.g. Meter, Kilometer, Mile, etc ...).Returns the short name of thisTLcdDistanceUnit(e.g. m, km, mi, etc ...).The name of the unit of measureThe symbol used for the unit of measureinthashCode()static voidremoveDistanceUnit(TLcdDistanceUnit aDistanceUnit) Removes the specified distance unit from the set of distance units which are registered for this JVM session.static voidsetAllDistanceUnits(TLcdDistanceUnit[] aAllDistanceUnitArray) Sets statically allTLcdDistanceUnitto consider in a JVM session.toString()Returns the unit name.
-
Field Details
-
METRE_UNIT
Distance unit for meters. This constant is an alias forTLcdUnitOfMeasureFactory.DISTANCE_METRE. -
KM_UNIT
Distance unit for kilometers. This constant is an alias forTLcdUnitOfMeasureFactory.DISTANCE_KILOMETRE. -
NM_UNIT
Distance unit for nautical miles. This constant is an alias forTLcdUnitOfMeasureFactory.DISTANCE_NAUTICAL_MILE. -
MILE_US_UNIT
Distance unit for miles (US). This constant is an alias forTLcdUnitOfMeasureFactory.DISTANCE_MILE. -
FT_UNIT
Distance unit for feet. This constant is an alias forTLcdUnitOfMeasureFactory.DISTANCE_FEET.
-
-
Constructor Details
-
TLcdDistanceUnit
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
Returns the name of thisTLcdDistanceUnit(e.g. Meter, Kilometer, Mile, etc ...).- Returns:
- the name of this
TLcdDistanceUnit(e.g. Meter, Kilometer, Mile, etc ...).
-
getUnitShortName
Returns the short name of thisTLcdDistanceUnit(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
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
Sets statically allTLcdDistanceUnitto 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
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
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
Returns the unit name. -
getUOMName
Description copied from interface:ILcdISO19103UnitOfMeasureThe name of the unit of measure- Specified by:
getUOMNamein interfaceILcdISO19103UnitOfMeasure- Returns:
- the name of the unit of measure
-
getUOMSymbol
Description copied from interface:ILcdISO19103UnitOfMeasureThe symbol used for the unit of measure- Specified by:
getUOMSymbolin interfaceILcdISO19103UnitOfMeasure- Returns:
- the symbol used for the unit of measure
-
getMeasureType
Description copied from interface:ILcdISO19103UnitOfMeasureThe type of measure this unit of measure is used for.- Specified by:
getMeasureTypein interfaceILcdISO19103UnitOfMeasure- Returns:
- the type of measure this unit of measure is used for.
-
getNameOfStandardUnit
Description copied from interface:ILcdISO19103UnitOfMeasureThe name of the standard unit for this type of measures.- Specified by:
getNameOfStandardUnitin interfaceILcdISO19103UnitOfMeasure- Returns:
- the name of the standard unit for this type of measures.
-
convertToStandard
public double convertToStandard(double aValue) Description copied from interface:ILcdISO19103UnitOfMeasureConverts a value which is assumed in this unit of measure to the standard unit of measure.- Specified by:
convertToStandardin interfaceILcdISO19103UnitOfMeasure
-
convertFromStandard
public double convertFromStandard(double aValue) Description copied from interface:ILcdISO19103UnitOfMeasureConverts a value which is assumed in the standard unit of measure to the unit of measure in the measureSFCT.- Specified by:
convertFromStandardin interfaceILcdISO19103UnitOfMeasure
-
equals
-
hashCode
public int hashCode()
-