Enum TraitUnitDimension
- All Implemented Interfaces:
Comparable<TraitUnitDimension>
TraitUnit measures. Two units convert into one another only when
they share a dimension; asking for anything else is a bug in the calling
code and throws.-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA plane angle, used for colour hue.The correlated colour temperature of a light.A concentration expressed as mass per volume, used for particulate matter.A concentration expressed as a fraction of the whole -- parts per million and its relatives.A bare number with no unit -- an ordinal, a count, a boolean carried as a number.Illuminance.A proportion.Temperature. -
Method Summary
Modifier and TypeMethodDescriptionstatic TraitUnitDimensionReturns the enum constant of this type with the specified name.static TraitUnitDimension[]values()Returns an array containing the constants of this enum type, in the order they are declared.Methods inherited from class Enum
clone, compareTo, equals, getDeclaringClass, getEnumValues, hashCode, name, ordinal, setEnumValues, toString, valueOf
-
Enum Constant Details
-
DIMENSIONLESS
A bare number with no unit -- an ordinal, a count, a boolean carried as a number. -
RATIO
A proportion. Canonical unitTraitUnit.PERCENT. -
TEMPERATURE
Temperature. Canonical unitTraitUnit.CELSIUS. The only dimension here that needs the affine offset. -
ANGLE
A plane angle, used for colour hue. Canonical unitTraitUnit.ARC_DEGREE. -
COLOR_TEMPERATURE
The correlated colour temperature of a light. Canonical unit
TraitUnit.MIRED.Its own dimension rather than a member of
TEMPERATURE, which it resembles only by name: a light at 250 mireds is not 250 degrees of anything, and letting the two convert would turn a thermostat setpoint into a colour by arithmetic that raises no error. -
ILLUMINANCE
Illuminance. Canonical unitTraitUnit.LUX. -
CONCENTRATION_PARTS
A concentration expressed as a fraction of the whole -- parts per million and its relatives. Canonical unit
TraitUnit.PPM.Deliberately does not convert to
CONCENTRATION_MASS. Going between parts-per and micrograms per cubic metre needs the molar mass of the gas and the ambient temperature and pressure, none of which this API has. Accessories report one or the other; where the platform gives a value in the dimension the trait does not use, the port reports no value rather than inventing the missing physics. -
CONCENTRATION_MASS
A concentration expressed as mass per volume, used for particulate matter. Canonical unitTraitUnit.MICROGRAM_PER_CUBIC_METER.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-