Package gaiasky.util
Enum Class Settings.DistanceUnits
- All Implemented Interfaces:
Serializable
,Comparable<Settings.DistanceUnits>
,Constable
- Enclosing class:
Settings
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
fromInternalUnits
(double internal) Returns the given value, given in internal units, in the units represented by this object.double
toInternalUnits
(double value) Converts the given value in the units represented by this object in internal units.static Settings.DistanceUnits
Returns the enum constant of this class with the specified name.static Settings.DistanceUnits[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INTERNAL
-
M
-
KM
-
AU
-
PC
-
LY
-
-
Field Details
-
toKm
public final double toKm -
fromKm
public final double fromKm
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
getUnitString
-
toInternalUnits
public double toInternalUnits(double value) Converts the given value in the units represented by this object in internal units.- Parameters:
value
- The value in the units represented by this object.- Returns:
- The value in internal units.
-
fromInternalUnits
public double fromInternalUnits(double internal) Returns the given value, given in internal units, in the units represented by this object.- Parameters:
internal
- The value in internal units.- Returns:
- The value in the units represented by this object.
-