@Status(stage=TEST, unitTests=ABSENT) public enum BritishImperialLength extends Enum<BritishImperialLength>
Enum Constant and Description |
---|
FOOT
Foot.
|
INCH
Inch.
|
MILE
Mile.
|
YARD
Yard.
|
Modifier and Type | Field and Description |
---|---|
static int |
FEET_IN_YARD
Number of feet in a yard.
|
static int |
INCHES_IN_FOOT
Number of inches in a foot.
|
static int |
YARDS_IN_MILE
Number of yard in a mile.
|
Modifier and Type | Method and Description |
---|---|
double |
fromMiles(double length)
Converts the supplied length in miles to this length.
|
double |
fromYards(double length)
Converts the supplied length in yards to this length.
|
double |
toMiles(double length)
Converts the supplied length into miles.
|
double |
toYards(double length)
Converts the supplied length into yards.
|
static BritishImperialLength |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BritishImperialLength[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BritishImperialLength MILE
public static final BritishImperialLength YARD
public static final BritishImperialLength FOOT
public static final BritishImperialLength INCH
public static final int INCHES_IN_FOOT
public static final int FEET_IN_YARD
public static final int YARDS_IN_MILE
public static BritishImperialLength[] values()
for (BritishImperialLength c : BritishImperialLength.values()) System.out.println(c);
public static BritishImperialLength 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 toMiles(double length)
length
- The length to convert to miles.public double fromMiles(double length)
length
- The length in miles to convert to this length.public double toYards(double length)
length
- The length to convert to yards.public double fromYards(double length)
length
- The length in yards to convert to this length.Copyright © 2008–2018. All rights reserved.