public enum TraitUnitDimension
- Object
- Enum<TraitUnitDimension>
- TraitUnitDimension
ImplementsComparable<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 constants
DIMENSIONLESS | A bare number with no unit – an ordinal, a count, a boolean carried as a number. |
RATIO | A proportion. |
TEMPERATURE | Temperature. |
ANGLE | A plane angle, used for colour hue. |
COLOR_TEMPERATURE | The correlated colour temperature of a light. |
ILLUMINANCE | Illuminance. |
CONCENTRATION_PARTS | A concentration expressed as a fraction of the whole – parts per million and its relatives. |
CONCENTRATION_MASS | A concentration expressed as mass per volume, used for particulate matter. |
Methods
public static TraitUnitDimension[] values() | |
public static TraitUnitDimension valueOf(String name) |
Inherited methods
Enum constant details
DIMENSIONLESS
DIMENSIONLESSRATIO
RATIOTraitUnit.PERCENT.TEMPERATURE
TEMPERATURETraitUnit.CELSIUS. The only dimension
here that needs the affine offset.ANGLE
ANGLETraitUnit.ARC_DEGREE.COLOR_TEMPERATURE
COLOR_TEMPERATUREThe 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
ILLUMINANCETraitUnit.LUX.CONCENTRATION_PARTS
CONCENTRATION_PARTSA 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
CONCENTRATION_MASSTraitUnit.MICROGRAM_PER_CUBIC_METER.Method details
values
public static TraitUnitDimension[] values()valueOf
public static TraitUnitDimension valueOf(String name)