Package com.luciad.util
Class TLcdAngleUnit
java.lang.Object
com.luciad.util.TLcdAngleUnit
- All Implemented Interfaces:
ILcdISO19103UnitOfMeasure
,Serializable
This class defines angle unit constants. The standard unit
is 'radians'.
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final TLcdAngleUnit
Constant defining angle as degrees (1° = 1/360 of a circle).static final TLcdAngleUnit
Constant defining angle as gradians (1 gon = 1/400 of a circle).static final TLcdAngleUnit
Constant defining the angle in angular mils as defined by NATO (1/6400 of a circle).static final TLcdAngleUnit
Constant defining angle as radians (1 rad = 1/(2Π) of a circle). -
Constructor Summary
ConstructorDescriptionTLcdAngleUnit
(String aUnitName, String aUnitShortName, double aToRadianFactor) Constructs a new angle unit. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addAngleUnit
(TLcdAngleUnit aAngleUnit) Adds the specified angle unit to the set of angle units which are registered for this JVM session.double
convertFromStandard
(double aValue) Converts the value expressed in radians to this unit.double
convertToStandard
(double aValue) Converts the value expressed in this unit to radians.boolean
static TLcdAngleUnit[]
Returns the available angle 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 an angle expressed in that specific unit into an angle in radians.Returns the name of thisTLcdAngleUnit
(e.g. Radians, Degrees, Gradians).Returns the short name of thisTLcdAngleUnit
(e.g. rad, deg,gr).The name of the unit of measureThe symbol used for the unit of measureint
hashCode()
static void
removeAngleUnit
(TLcdAngleUnit aAngleUnit) Removes the specified angle unit from the set of angle units which are registered for this JVM session.static void
setAllAngleUnits
(TLcdAngleUnit[] aAngleUnits) Sets statically allTLcdAngleUnit
s to consider in a JVM session.toString()
Returns the unit name.
-
Field Details
-
RADIAN
Constant defining angle as radians (1 rad = 1/(2Π) of a circle). This constant is an alias forTLcdUnitOfMeasureFactory.ANGLE_RADIAN
. -
DEGREE
Constant defining angle as degrees (1° = 1/360 of a circle). This constant is an alias forTLcdUnitOfMeasureFactory.ANGLE_DEGREE
. -
GRADIAN
Constant defining angle as gradians (1 gon = 1/400 of a circle). This constant is an alias forTLcdUnitOfMeasureFactory.ANGLE_GRADIAN
. -
MIL
Constant defining the angle in angular mils as defined by NATO (1/6400 of a circle). This constant is an alias forTLcdUnitOfMeasureFactory.ANGLE_MIL
.
-
-
Constructor Details
-
TLcdAngleUnit
Constructs a new angle unit.- Parameters:
aUnitName
- The name of the unit.aUnitShortName
- The short name of the unit, typically used as the suffix after a number.aToRadianFactor
- The factor to convert a value expressed in this unit to radians. For example, if the unit is degrees, the factor is2*Math.PI/360
.
-
-
Method Details
-
getUnitName
Returns the name of thisTLcdAngleUnit
(e.g. Radians, Degrees, Gradians).- Returns:
- the name of this
TLcdAngleUnit
(e.g. Radians, Degrees, Gradians).
-
getUnitShortName
Returns the short name of thisTLcdAngleUnit
(e.g. rad, deg,gr).- Returns:
- the short name of this
TLcdAngleUnit
(e.g. rad, deg,gr).
-
getToRadianFactor
public double getToRadianFactor()Returns the factor to apply to convert an angle expressed in that specific unit into an angle in radians.- Returns:
- the factor to apply to convert an angle expressed in that specific unit into an angle in radians.
-
getAllAngleUnits
Returns the available angle units to consider in a JVM session.- Returns:
- the available angle units to consider in a JVM session.
- See Also:
-
setAllAngleUnits
Sets statically allTLcdAngleUnit
s to consider in a JVM session. Typically, this method should be called in the main of the application.- Parameters:
aAngleUnits
- the angle units to consider in a JVM session.- See Also:
-
addAngleUnit
Adds the specified angle unit to the set of angle units which are registered for this JVM session.- Parameters:
aAngleUnit
- an angle unit to be registered for this JVM session.- Throws:
IllegalArgumentException
- If a angle unit with the same symbol was already registered before.
-
removeAngleUnit
Removes the specified angle unit from the set of angle units which are registered for this JVM session.- Parameters:
aAngleUnit
- an angle unit to be removed for this JVM session.- Throws:
IllegalArgumentException
- If the specified angle unit is not contained in the list of registered angle 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:
TLcdISO19103MeasureTypeCode.ANGLE
.
-
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) Converts the value expressed in this unit to radians.- Specified by:
convertToStandard
in interfaceILcdISO19103UnitOfMeasure
- Parameters:
aValue
- a angle expressed in this unit.- Returns:
- the same angle expressed in radians.
-
convertFromStandard
public double convertFromStandard(double aValue) Converts the value expressed in radians to this unit.- Specified by:
convertFromStandard
in interfaceILcdISO19103UnitOfMeasure
- Parameters:
aValue
- a angle expressed in radians.- Returns:
- the same angle expressed in this unit.
-
equals
-
hashCode
public int hashCode()
-