@Status(stage=TEST, unitTests=ABSENT) public enum MetricLength extends Enum<MetricLength>
Enum Constant and Description |
---|
CENTIMETER
Centimeter.
|
DECAMETER
Decameter.
|
DECIMETER
Decimeter.
|
HECTOMETER
Hectometer.
|
KILOMETER
Kilometer.
|
METER
Meter.
|
MILLIMETER
Millimeter.
|
Modifier and Type | Method and Description |
---|---|
double |
fromKilometers(double length)
Converts the supplied length in kilometers to this length.
|
double |
fromMeters(double length)
Converts the supplied length in meters to this length.
|
double |
toKilometers(double length)
Converts the supplied length into kilometers.
|
double |
toMeters(double length)
Converts the supplied length into meters.
|
static MetricLength |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MetricLength[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MetricLength KILOMETER
public static final MetricLength HECTOMETER
public static final MetricLength DECAMETER
public static final MetricLength METER
public static final MetricLength DECIMETER
public static final MetricLength CENTIMETER
public static final MetricLength MILLIMETER
public static MetricLength[] values()
for (MetricLength c : MetricLength.values()) System.out.println(c);
public static MetricLength valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic double toKilometers(double length)
length
- The length to convert to kilometers.public double fromKilometers(double length)
length
- The length in kilometers to convert to this length.public double toMeters(double length)
length
- The length to convert to meters.public double fromMeters(double length)
length
- The length in meters to convert to this length.Copyright © 2008–2018. All rights reserved.