public enum MeasurementUnit extends Enum<MeasurementUnit>
Modifier and Type | Class and Description |
---|---|
static class |
MeasurementUnit.Family |
static class |
MeasurementUnit.MeasurementConversionException |
Enum Constant and Description |
---|
BITS |
BYTES |
CELSIUS |
DAYS |
EPOCH_MILLISECONDS |
EPOCH_SECONDS |
FAHRENHEIGHT |
GIGABITS |
GIGABYTES |
HOURS |
JIFFYS |
KELVIN |
KILOBITS |
KILOBYTES |
MEGABITS |
MEGABYTES |
MICROSECONDS |
MILLISECONDS |
MINUTES |
NANOSECONDS |
NONE |
PER_DAY |
PER_HOUR |
PER_JIFFY |
PER_MICROSECOND |
PER_MILLISECOND |
PER_MINUTE |
PER_NANOSECOND |
PER_SECOND |
PERCENTAGE |
PETABITS |
PETABYTES |
SECONDS |
TERABITS |
TERABYTES |
Modifier and Type | Method and Description |
---|---|
static Double |
calculateOffset(MeasurementUnit first,
MeasurementUnit second) |
MeasurementUnit |
getBaseUnits() |
MeasurementUnit.Family |
getFamily() |
String |
getName()
A Java bean style getter to allow us to access the enum name from JSPs (e.g.
|
static MeasurementUnit |
getUsingDisplayUnits(String displayUnits,
MeasurementUnit.Family family) |
boolean |
isComparableTo(MeasurementUnit other) |
String |
toString() |
static MeasurementUnit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static MeasurementUnit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final MeasurementUnit NONE
public static final MeasurementUnit PERCENTAGE
public static final MeasurementUnit BYTES
public static final MeasurementUnit KILOBYTES
public static final MeasurementUnit MEGABYTES
public static final MeasurementUnit GIGABYTES
public static final MeasurementUnit TERABYTES
public static final MeasurementUnit PETABYTES
public static final MeasurementUnit BITS
public static final MeasurementUnit KILOBITS
public static final MeasurementUnit MEGABITS
public static final MeasurementUnit GIGABITS
public static final MeasurementUnit TERABITS
public static final MeasurementUnit PETABITS
public static final MeasurementUnit EPOCH_MILLISECONDS
public static final MeasurementUnit EPOCH_SECONDS
public static final MeasurementUnit JIFFYS
public static final MeasurementUnit NANOSECONDS
public static final MeasurementUnit MICROSECONDS
public static final MeasurementUnit MILLISECONDS
public static final MeasurementUnit SECONDS
public static final MeasurementUnit MINUTES
public static final MeasurementUnit HOURS
public static final MeasurementUnit DAYS
public static final MeasurementUnit PER_JIFFY
public static final MeasurementUnit PER_NANOSECOND
public static final MeasurementUnit PER_MICROSECOND
public static final MeasurementUnit PER_MILLISECOND
public static final MeasurementUnit PER_SECOND
public static final MeasurementUnit PER_MINUTE
public static final MeasurementUnit PER_HOUR
public static final MeasurementUnit PER_DAY
public static final MeasurementUnit CELSIUS
public static final MeasurementUnit KELVIN
public static final MeasurementUnit FAHRENHEIGHT
public static MeasurementUnit[] values()
for (MeasurementUnit c : MeasurementUnit.values()) System.out.println(c);
public static MeasurementUnit 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 static MeasurementUnit getUsingDisplayUnits(String displayUnits, MeasurementUnit.Family family)
public MeasurementUnit getBaseUnits()
public boolean isComparableTo(MeasurementUnit other)
public static Double calculateOffset(MeasurementUnit first, MeasurementUnit second) throws MeasurementUnit.MeasurementConversionException
public MeasurementUnit.Family getFamily()
public String getName()
public String toString()
toString
in class Enum<MeasurementUnit>
Copyright © 2021 JBoss by Red Hat. All rights reserved.