public enum SpeedUnit extends Enum<SpeedUnit>
| Enum Constant and Description |
|---|
KILOMETERS_PER_HOUR
Kilometers per hour.
|
KNOTS
Knots.
|
METERS_PER_SECOND
Meters Per Second.
|
MILES_PER_HOUR
Miles Per Hour.
|
| Modifier and Type | Method and Description |
|---|---|
abstract double |
toKilometersPerHour(double speed)
Converts the specified speed from this speed unit to kilometers per hour.
|
abstract double |
toKnots(double speed)
Converts the specified speed from this speed unit to knots.
|
abstract double |
toMetersPerSecond(double speed)
Converts the specified speed from this speed unit to miles per hour.
|
abstract double |
toMilesPerHour(double speed)
Converts the specified speed from this speed unit to miles per hour.
|
static SpeedUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SpeedUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SpeedUnit KILOMETERS_PER_HOUR
public static final SpeedUnit KNOTS
public static final SpeedUnit METERS_PER_SECOND
public static final SpeedUnit MILES_PER_HOUR
public static SpeedUnit[] values()
for (SpeedUnit c : SpeedUnit.values()) System.out.println(c);
public static SpeedUnit 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 abstract double toKilometersPerHour(double speed)
SpeedUnit.METERS_PER_SECOND.toKilometersPerHour(100).speed - the speed to convertpublic abstract double toKnots(double speed)
SpeedUnit.METERS_PER_SECOND.toKnots(100).speed - the speed to convertpublic abstract double toMetersPerSecond(double speed)
SpeedUnit.KNOTS.toMetersPerSecond(100).speed - the speed to convertpublic abstract double toMilesPerHour(double speed)
SpeedUnit.METERS_PER_SECOND.toMilesPerHour(100).speed - the speed to convertCopyright © 2012–2015 Danish Maritime Authority. All rights reserved.