public enum Units extends Enum<Units>
| Enum Constant and Description |
|---|
ARC_MINUTE
Arc-minute unit
|
ARC_SECOND
Arc-second unit
|
BIN
Bin unit
|
CALENDAR_MONTH
Calendar month unit
|
CALENDAR_SECOND
Calendar second unit
|
DAY
Day unit
|
DEGREE
Degree unit
|
FOOT
Foot unit
|
GERMAN_LEGAL_METRE
German legal metre unit
|
GRAD
Grad unit
|
HECTOPASCAL
Hectopascal unit
|
HOUR
Hour unit
|
KILOMETRE
Kilometre unit
|
METRE
Metre unit
|
MICROMETRE
Micrometre unit
|
MICRORADIAN
Microradian unit
|
MICROSECOND
Microsecond unit
|
MILLIMETRE
Millimetre unit
|
MILLIRADIAN
Milliradian unit
|
MILLISECOND
Millisecond unit
|
MINUTE
Minute unit
|
PARTS_PER_MILLION
Parts per million unit
|
PASCAL
Pascal unit
|
RADIAN
Radian unit
|
SECOND
Second unit
|
UNITY
Unity unit
|
US_SURVEY_FOOT
US survey foot unit
|
YEAR
Year unit
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
canConvert(Unit unit1,
Unit unit2)
Determine if values can be converted between the two units
|
static double |
convert(double value,
Unit from,
Unit to)
Convert the value from a unit to a same typed unit, both with conversion
factors
|
static Unit |
createDefaultUnit(UnitType type)
Create the default unit for the unit type
|
Unit |
createUnit()
Create a unit
|
static Units |
fromName(String name)
Get the units type from the name
|
static Units |
fromUnit(Unit unit)
Get the units type from the unit
|
Double |
getConversionFactor()
Get the conversion factor
|
static Units |
getDefaultUnit(UnitType type)
Get the default unit for the unit type
|
String |
getName()
Get the name
|
UnitType |
getType()
Get the type
|
static UnitType |
getUnitType(String name)
Get the unit type from the name
|
boolean |
hasConversionFactor()
Has conversion factor
|
static Units |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Units[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Units MICROMETRE
public static final Units MILLIMETRE
public static final Units METRE
public static final Units KILOMETRE
public static final Units GERMAN_LEGAL_METRE
public static final Units US_SURVEY_FOOT
public static final Units FOOT
public static final Units MICRORADIAN
public static final Units MILLIRADIAN
public static final Units RADIAN
public static final Units ARC_SECOND
public static final Units ARC_MINUTE
public static final Units DEGREE
public static final Units GRAD
public static final Units UNITY
public static final Units BIN
public static final Units PARTS_PER_MILLION
public static final Units PASCAL
public static final Units HECTOPASCAL
public static final Units MICROSECOND
public static final Units MILLISECOND
public static final Units SECOND
public static final Units MINUTE
public static final Units HOUR
public static final Units DAY
public static final Units YEAR
public static final Units CALENDAR_SECOND
public static final Units CALENDAR_MONTH
public static Units[] values()
for (Units c : Units.values()) System.out.println(c);
public static Units 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 UnitType getType()
public String getName()
public boolean hasConversionFactor()
public Double getConversionFactor()
public Unit createUnit()
public static Units fromName(String name)
name - unit namepublic static Units fromUnit(Unit unit)
unit - unitpublic static UnitType getUnitType(String name)
name - unit namepublic static Units getDefaultUnit(UnitType type)
type - unit typepublic static Unit createDefaultUnit(UnitType type)
type - unit typepublic static boolean canConvert(Unit unit1, Unit unit2)
unit1 - first unitunit2 - second unitCopyright © 2021 National Geospatial-Intelligence Agency. All rights reserved.