| Enum Constant and Description |
|---|
CENTIMETER |
FOOT |
INCH |
KILOMETER |
METER |
MILE |
MILLIMETER |
YARD |
| Modifier and Type | Field and Description |
|---|---|
java.lang.String |
abbreviation |
double |
unitToMeter |
| Modifier and Type | Method and Description |
|---|---|
double |
conversion(Unit to) |
static double |
conversion(Unit from,
Unit to) |
double |
convert(double value,
Unit to) |
java.lang.String |
getAbbreviation() |
double |
getUnitToMeter() |
static Unit |
lookup(java.lang.String word)
Sees if the specified work matches any of the units full name or short name.
|
static Unit |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static Unit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Unit MILLIMETER
public static final Unit CENTIMETER
public static final Unit METER
public static final Unit KILOMETER
public static final Unit INCH
public static final Unit FOOT
public static final Unit YARD
public static final Unit MILE
public double unitToMeter
public java.lang.String abbreviation
public static Unit[] values()
for (Unit c : Unit.values()) System.out.println(c);
public static Unit valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static Unit lookup(java.lang.String word)
public double convert(double value,
Unit to)
public double conversion(Unit to)
public double getUnitToMeter()
public java.lang.String getAbbreviation()