|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<LengthUnit>
com.javadocmd.simplelatlng.util.LengthUnit
public enum LengthUnit
A utility class for handling units and unit conversions within this library.
| Enum Constant Summary | |
|---|---|
KILOMETER
Kilometers, the primary unit. |
|
METER
Meters, for ease of use. |
|
MILE
Miles, using the scale factor 0.6213712 miles per kilometer. |
|
NAUTICAL_MILE
Nautical miles, using the scale factor 0.5399568 nautical miles per kilometer. |
|
ROD
Rods, using the scale factor 0.0050292 rods to the kilometer. |
|
| Field Summary | |
|---|---|
static LengthUnit |
PRIMARY
The primary length unit. |
| Method Summary | |
|---|---|
double |
convertTo(LengthUnit toUnit,
double value)
Convert a value of this unit type to the units specified in the parameters. |
double |
getScaleFactor()
Retrieve the scale factor between this unit and the primary length unit. |
static LengthUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static LengthUnit[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final LengthUnit MILE
public static final LengthUnit NAUTICAL_MILE
public static final LengthUnit ROD
public static final LengthUnit KILOMETER
public static final LengthUnit METER
| Field Detail |
|---|
public static final LengthUnit PRIMARY
| Method Detail |
|---|
public static LengthUnit[] values()
for (LengthUnit c : LengthUnit.values()) System.out.println(c);
public static LengthUnit valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is null
public double convertTo(LengthUnit toUnit,
double value)
toUnit - the unit to convert to.value - the value to convert.
public double getScaleFactor()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||