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
Modifier and TypeFieldDescriptionstatic final TLcdDistanceUnit
Distance unit for feet.static final TLcdDistanceUnit
Distance unit for kilometers.static final TLcdDistanceUnit
Distance unit for meters.static final TLcdDistanceUnit
Distance unit for miles (US).static final TLcdDistanceUnit
Distance unit for nautical miles. -
Constructor Summary
ConstructorDescriptionTLcdDistanceUnit
(String aUnitName, String aUnitShortName, double aToMetreFactor) Constructs a new distance unit. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addDistanceUnit
(TLcdDistanceUnit aDistanceUnit) Adds the specified distance unit to the set of distance units which are registered for this JVM session.double
convertFromStandard
(double aValue) Converts a value which is assumed in the standard unit of measure to the unit of measure in the measureSFCT.double
convertToStandard
(double aValue) Converts a value which is assumed in this unit of measure to the standard unit of measure.boolean
static 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.double
Returns 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 measureint
hashCode()
static void
removeDistanceUnit
(TLcdDistanceUnit aDistanceUnit) Removes the specified distance unit from the set of distance units which are registered for this JVM session.static void
setAllDistanceUnits
(TLcdDistanceUnit[] aAllDistanceUnitArray) Sets statically allTLcdDistanceUnit
to 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 allTLcdDistanceUnit
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
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:ILcdISO19103UnitOfMeasure
The name of the unit of measure- Specified by:
getUOMName
in interfaceILcdISO19103UnitOfMeasure
- Returns:
- the name of the unit of measure
-
getUOMSymbol
Description copied from interface:ILcdISO19103UnitOfMeasure
The symbol used for the unit of measure- Specified by:
getUOMSymbol
in interfaceILcdISO19103UnitOfMeasure
- Returns:
- the symbol used for the unit of measure
-
getMeasureType
Description copied from interface:ILcdISO19103UnitOfMeasure
The type of measure this unit of measure is used for.- Specified by:
getMeasureType
in interfaceILcdISO19103UnitOfMeasure
- Returns:
- the type of measure this unit of measure is used for.
-
getNameOfStandardUnit
Description copied from interface:ILcdISO19103UnitOfMeasure
The name of the standard unit for this type of measures.- Specified by:
getNameOfStandardUnit
in interfaceILcdISO19103UnitOfMeasure
- 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 interfaceILcdISO19103UnitOfMeasure
-
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 interfaceILcdISO19103UnitOfMeasure
-
equals
-
hashCode
public int hashCode()
-