Enum Class MeasurementUnit
- All Implemented Interfaces:
Serializable,Comparable<MeasurementUnit>,Constable
Metric data values can be in one of the following known units of measurement. These enum values should correspond to
the "units" attribute enumerated type values as defined in the plugin descriptor's <metric> element.
- Author:
- Joseph Marques, Brian Stansberry (c) 2011 Red Hat Inc.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classNested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic DoublecalculateOffset(MeasurementUnit first, MeasurementUnit second) getName()A Java bean style getter to allow us to access the enum name from JSPs (e.g.static MeasurementUnitgetUsingDisplayUnits(String displayUnits, MeasurementUnit.Family family) booleanisComparableTo(MeasurementUnit other) toString()static MeasurementUnitReturns the enum constant of this class with the specified name.static MeasurementUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
-
PERCENTAGE
-
BYTES
-
KILOBYTES
-
MEGABYTES
-
GIGABYTES
-
TERABYTES
-
PETABYTES
-
BITS
-
KILOBITS
-
MEGABITS
-
GIGABITS
-
TERABITS
-
PETABITS
-
EPOCH_MILLISECONDS
-
EPOCH_SECONDS
-
JIFFYS
-
NANOSECONDS
-
MICROSECONDS
-
MILLISECONDS
-
SECONDS
-
MINUTES
-
HOURS
-
DAYS
-
PER_JIFFY
-
PER_NANOSECOND
-
PER_MICROSECOND
-
PER_MILLISECOND
-
PER_SECOND
-
PER_MINUTE
-
PER_HOUR
-
PER_DAY
-
CELSIUS
-
KELVIN
-
FAHRENHEIGHT
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getUsingDisplayUnits
public static MeasurementUnit getUsingDisplayUnits(String displayUnits, MeasurementUnit.Family family) -
getBaseUnits
-
isComparableTo
-
calculateOffset
public static Double calculateOffset(MeasurementUnit first, MeasurementUnit second) throws MeasurementUnit.MeasurementConversionException -
getFamily
-
getName
A Java bean style getter to allow us to access the enum name from JSPs (e.g. ${measureUnits.name}).- Returns:
- the enum name
-
toString
- Overrides:
toStringin classEnum<MeasurementUnit>
-