public class TLcdDistanceUnit extends Object implements Serializable, ILcdISO19103UnitOfMeasure
Modifier and Type | Field and Description |
---|---|
static TLcdDistanceUnit |
FT_UNIT
Distance unit for feet.
|
static TLcdDistanceUnit |
KM_UNIT
Distance unit for kilometers.
|
static TLcdDistanceUnit |
METRE_UNIT
Distance unit for meters.
|
static TLcdDistanceUnit |
MILE_US_UNIT
Distance unit for miles (US).
|
static TLcdDistanceUnit |
NM_UNIT
Distance unit for nautical miles.
|
Constructor and Description |
---|
TLcdDistanceUnit(String aUnitName,
String aUnitShortName,
double aToMetreFactor)
Constructs a new distance unit.
|
Modifier and Type | Method and Description |
---|---|
static 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 |
equals(Object aO) |
static TLcdDistanceUnit[] |
getAllDistanceUnits()
Returns the available distance units to consider in a JVM session.
|
TLcdISO19103MeasureTypeCode |
getMeasureType()
The type of measure this unit of measure is used for.
|
String |
getNameOfStandardUnit()
The name of the standard unit for this type of measures.
|
double |
getToMetreFactor()
Returns the factor to apply to convert a distance expressed in that specific unit into a distance in meters.
|
String |
getUnitName()
Returns the name of this
TLcdDistanceUnit (e.g. Meter, Kilometer, Mile, etc ...). |
String |
getUnitShortName()
Returns the short name of this
TLcdDistanceUnit (e.g. m, km, mi, etc ...). |
String |
getUOMName()
The name of the unit of measure
|
String |
getUOMSymbol()
The symbol used for the unit of measure
|
int |
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 all
TLcdDistanceUnit to consider in a JVM session. |
String |
toString()
Returns the unit name.
|
public static final TLcdDistanceUnit METRE_UNIT
TLcdUnitOfMeasureFactory.DISTANCE_METRE
.public static final TLcdDistanceUnit KM_UNIT
TLcdUnitOfMeasureFactory.DISTANCE_KILOMETRE
.public static final TLcdDistanceUnit NM_UNIT
TLcdUnitOfMeasureFactory.DISTANCE_NAUTICAL_MILE
.public static final TLcdDistanceUnit MILE_US_UNIT
TLcdUnitOfMeasureFactory.DISTANCE_MILE
.public static final TLcdDistanceUnit FT_UNIT
TLcdUnitOfMeasureFactory.DISTANCE_FEET
.public TLcdDistanceUnit(String aUnitName, String aUnitShortName, double aToMetreFactor)
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.public String getUnitName()
TLcdDistanceUnit
(e.g. Meter, Kilometer, Mile, etc ...).TLcdDistanceUnit
(e.g. Meter, Kilometer, Mile, etc ...).public String getUnitShortName()
TLcdDistanceUnit
(e.g. m, km, mi, etc ...).TLcdDistanceUnit
(e.g. m, km, mi, etc ...).public double getToMetreFactor()
public static TLcdDistanceUnit[] getAllDistanceUnits()
setAllDistanceUnits(com.luciad.util.TLcdDistanceUnit[])
public static void setAllDistanceUnits(TLcdDistanceUnit[] aAllDistanceUnitArray)
TLcdDistanceUnit
to consider in a JVM session. Typically, this method should
be called in the main of the application.aAllDistanceUnitArray
- the distance units to consider in a JVM sessiongetAllDistanceUnits()
public static void addDistanceUnit(TLcdDistanceUnit aDistanceUnit)
aDistanceUnit
- a distance unit to be registered for this JVM session.IllegalArgumentException
- If a distance unit with the same symbol was already registered before.public static void removeDistanceUnit(TLcdDistanceUnit aDistanceUnit)
aDistanceUnit
- a distance unit to be removed for this JVM session.IllegalArgumentException
- If the specified distance unit is not contained in the list of
registered distance units.public String toString()
public String getUOMName()
ILcdISO19103UnitOfMeasure
getUOMName
in interface ILcdISO19103UnitOfMeasure
public String getUOMSymbol()
ILcdISO19103UnitOfMeasure
getUOMSymbol
in interface ILcdISO19103UnitOfMeasure
public TLcdISO19103MeasureTypeCode getMeasureType()
ILcdISO19103UnitOfMeasure
getMeasureType
in interface ILcdISO19103UnitOfMeasure
public String getNameOfStandardUnit()
ILcdISO19103UnitOfMeasure
getNameOfStandardUnit
in interface ILcdISO19103UnitOfMeasure
public double convertToStandard(double aValue)
ILcdISO19103UnitOfMeasure
convertToStandard
in interface ILcdISO19103UnitOfMeasure
public double convertFromStandard(double aValue)
ILcdISO19103UnitOfMeasure
convertFromStandard
in interface ILcdISO19103UnitOfMeasure