Package org.djutils.serialization
Class SerializationUnits
java.lang.Object
org.djutils.serialization.SerializationUnits
- All Implemented Interfaces:
Serializable
The Sim0MQ unit types with their code, including static methods to quickly find a unit type.
Copyright (c) 2016-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See Sim0MQ License.
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final SerializationUnits
AbsoluteTemperature unit type with code 24.static final SerializationUnits
AbsorbedDose unit type with code 29.static final SerializationUnits
Acceleration unit type with code 1.static final SerializationUnits
AmountOfSubstance unit type with code 30.static final SerializationUnits
Angle unit type with code 3.static final SerializationUnits
AngularAcceleration unit type with code 42.static final SerializationUnits
AngularVelocity unit type with code 43.static final SerializationUnits
Area unit type with code 5.static final SerializationUnits
CatalyticActivity unit type with code 31.static final SerializationUnits
Density unit type with code 6.static final SerializationUnits
Dimensionless unit type with code 0.static final SerializationUnits
Direction unit type with code 4.static final SerializationUnits
Duration unit type with code 25.static final SerializationUnits
ElectricalCapacitance unit type with code 32.static final SerializationUnits
ElectricalCharge unit type with code 7.static final SerializationUnits
ElectricalConductance unit type with code 33.static final SerializationUnits
ElectricalCurrent unit type with code 8.static final SerializationUnits
ElectricalInductance unit type with code 34.static final SerializationUnits
ElectricalPotential unit type with code 9.static final SerializationUnits
ElectricalResistance unit type with code 10.static final SerializationUnits
Energy unit type with code 11.static final SerializationUnits
EquivalentDose unit type with code 35.static final SerializationUnits
FlowMass unit type with code 12.static final SerializationUnits
FlowVolume unit type with code 13.static final SerializationUnits
Force unit type with code 14.static final SerializationUnits
Frequency unit type with code 15.static final SerializationUnits
Illuminance unit type with code 36.static final SerializationUnits
Length unit type with code 16.static final SerializationUnits
LinearDensity unit type with code 18.static final SerializationUnits
LuminousFlux unit type with code 37.static final SerializationUnits
LuminousIntensity unit type with code 38.static final SerializationUnits
MagneticFlux unit type with code 40.static final SerializationUnits
MagneticFluxDensity unit type with code 39.static final SerializationUnits
Mass unit type with code 19.static final SerializationUnits
AngularAcceleration unit type with code 44.static final SerializationUnits
Position unit type with code 17.static final SerializationUnits
Power unit type with code 20.static final SerializationUnits
Pressure unit type with code 21.static final SerializationUnits
RadioActivity unit type with code 41.static final SerializationUnits
SolidAngle unit type with code 2.static final SerializationUnits
Speed unit type with code 22.static final SerializationUnits
Temperature unit type with code 23.static final SerializationUnits
Time unit type with code 26.static final SerializationUnits
Torque unit type with code 27.static final SerializationUnits
Volume unit type with code 28. -
Constructor Summary
ConstructorDescriptionSerializationUnits
(int code, Class<U> djunitsType, String name, String description, String siUnit) Construct a new UnitType and put it in the maps. -
Method Summary
Modifier and TypeMethodDescriptionboolean
final byte
getCode()
Retrieve the byte code of this UnitType.final String
Retrieve the description of this UnitType.final Class<? extends org.djunits.unit.Unit<?>>
Retrieve the DJUNITS type of this UnitType.final String
getName()
Retrieve the name of the UnitType.final String
Retrieve the SI unit of this UnitType.static Class<? extends org.djunits.unit.Unit<?>>
getUnitClass
(byte code) Return the unit class belonging to the byte code.static <U extends org.djunits.unit.Unit<U>>
bytegetUnitCode
(U unit) Return the byte code belonging to the unit class.static SerializationUnits
getUnitType
(byte code) Return the unit type belonging to the byte code.static <U extends org.djunits.unit.Unit<U>>
SerializationUnitsgetUnitType
(U unit) Return the unit type belonging to the unit class.int
hashCode()
toString()
-
Field Details
-
DIMENSIONLESS
Dimensionless unit type with code 0. -
ACCELERATION
Acceleration unit type with code 1. -
SOLIDANGLE
SolidAngle unit type with code 2. -
ANGLE
Angle unit type with code 3. -
DIRECTION
Direction unit type with code 4. -
AREA
Area unit type with code 5. -
DENSITY
Density unit type with code 6. -
ELECTRICALCHARGE
ElectricalCharge unit type with code 7. -
ELECTRICALCURRENT
ElectricalCurrent unit type with code 8. -
ELECTRICALPOTENTIAL
ElectricalPotential unit type with code 9. -
ELECTRICALRESISTANCE
ElectricalResistance unit type with code 10. -
ENERGY
Energy unit type with code 11. -
FLOWMASS
FlowMass unit type with code 12. -
FLOWVOLUME
FlowVolume unit type with code 13. -
FORCE
Force unit type with code 14. -
FREQUENCY
Frequency unit type with code 15. -
LENGTH
Length unit type with code 16. -
POSITION
Position unit type with code 17. -
LINEARDENSITY
LinearDensity unit type with code 18. -
MASS
Mass unit type with code 19. -
POWER
Power unit type with code 20. -
PRESSURE
Pressure unit type with code 21. -
SPEED
Speed unit type with code 22. -
TEMPERATURE
Temperature unit type with code 23. -
ABSOLUTETEMPERATURE
AbsoluteTemperature unit type with code 24. -
DURATION
Duration unit type with code 25. -
TIME
Time unit type with code 26. -
TORQUE
Torque unit type with code 27. -
VOLUME
Volume unit type with code 28. -
ABSORBEDDOSE
AbsorbedDose unit type with code 29. -
AMOUNTOFSUBSTANCE
AmountOfSubstance unit type with code 30. -
CATALYTICACTIVITY
CatalyticActivity unit type with code 31. -
ELECTRICALCAPACITANCE
ElectricalCapacitance unit type with code 32. -
ELECTRICALCONDUCTANCE
ElectricalConductance unit type with code 33. -
ELECTRICALINDUCTANCE
ElectricalInductance unit type with code 34. -
EQUIVALENTDOSE
EquivalentDose unit type with code 35. -
ILLUMINANCE
Illuminance unit type with code 36. -
LUMINOUSFLUX
LuminousFlux unit type with code 37. -
LUMINOUSINTENSITY
LuminousIntensity unit type with code 38. -
MAGNETICFLUXDENSITY
MagneticFluxDensity unit type with code 39. -
MAGNETICFLUX
MagneticFlux unit type with code 40. -
RADIOACTIVITY
RadioActivity unit type with code 41. -
ANGULARACCELERATION
AngularAcceleration unit type with code 42. -
ANGULARVELOCITY
AngularVelocity unit type with code 43. -
MOMENTUM
AngularAcceleration unit type with code 44.
-
-
Constructor Details
-
SerializationUnits
public SerializationUnits(int code, Class<U> djunitsType, String name, String description, String siUnit) Construct a new UnitType and put it in the maps.- Type Parameters:
U
- the Unit- Parameters:
code
- int; the byte code of the unit provided as an intdjunitsType
- Class<U>; the djunits data typename
- String; the unit namedescription
- String; the unit descriptionsiUnit
- String; the SI or default unit in SI-elements
-
-
Method Details
-
getUnitType
Return the unit type belonging to the byte code.- Parameters:
code
- byte; the code to search for.- Returns:
- UnitType; the unit type, or null if not found.
-
getUnitClass
Return the unit class belonging to the byte code.- Parameters:
code
- byte; the code to search for.- Returns:
- Class; the unit class, or null if not found.
-
getUnitType
Return the unit type belonging to the unit class.- Type Parameters:
U
- the Unit- Parameters:
unit
- U; the unit to search for.- Returns:
- UnitType; the unit type, or null if not found.
-
getUnitCode
public static <U extends org.djunits.unit.Unit<U>> byte getUnitCode(U unit) Return the byte code belonging to the unit class.- Type Parameters:
U
- the Unit- Parameters:
unit
- U; the unit to search for.- Returns:
- byte; the unit type code, or null if not found.
-
getCode
public final byte getCode()Retrieve the byte code of this UnitType.- Returns:
- byte; the byte code of this UnitType
-
getDjunitsType
Retrieve the DJUNITS type of this UnitType.- Returns:
- Class; the DJUNITS type of this UnitType
-
getName
Retrieve the name of the UnitType.- Returns:
- String; the name of this UnitType
-
getDescription
Retrieve the description of this UnitType.- Returns:
- String; the description of this UnitType
-
getSiUnit
Retrieve the SI unit of this UnitType.- Returns:
- String the SI unit of this UnitType
-
hashCode
public int hashCode() -
equals
-
toString
-