@Status(stage=TEST, unitTests=ABSENT) public enum BritishImperialMass extends Enum<BritishImperialMass>
Enum Constant and Description |
---|
OUNCE
Ounce.
|
POUND
Pound.
|
STONE
Stone.
|
Modifier and Type | Field and Description |
---|---|
static int |
OUNCES_IN_POUND
Number of ounces in a pound.
|
static int |
POUNDS_IN_STONE
Number of pounds in a stone.
|
Modifier and Type | Method and Description |
---|---|
double |
fromOunces(double mass)
Converts the supplied mass in ounces to this mass.
|
double |
fromPounds(double mass)
Converts the supplied mass in pounds to this mass.
|
double |
toOunces(double mass)
Converts the supplied mass into ounces.
|
double |
toPounds(double mass)
Converts the supplied mass into pounds.
|
static BritishImperialMass |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BritishImperialMass[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BritishImperialMass POUND
public static final BritishImperialMass OUNCE
public static final BritishImperialMass STONE
public static final int OUNCES_IN_POUND
public static final int POUNDS_IN_STONE
public static BritishImperialMass[] values()
for (BritishImperialMass c : BritishImperialMass.values()) System.out.println(c);
public static BritishImperialMass 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 toPounds(double mass)
mass
- The mass to convert to pounds.public double fromPounds(double mass)
mass
- The mass in pounds to convert to this mass.public double toOunces(double mass)
mass
- The mass to convert to ounces.public double fromOunces(double mass)
mass
- The mass in ounces to convert to this mass.Copyright © 2008–2018. All rights reserved.