Package org.djunits.quantity
Class Quantities
java.lang.Object
org.djunits.quantity.Quantities
- All Implemented Interfaces:
Serializable
UnitTypes is a singleton where the BaseUnit SIDimensions 'fingerprints' are stored and mapped to the BaseUnits. It is
possible that more baseUnits have the same fingerprint. E.g., Energy and Torque.
Copyright (c) 2019-2024 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License
- Author:
- Alexander Verbraeck
- See Also:
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetQuantities
(SIDimensions siDimensions) Retrieve a safe copy of the quantity set registered for an SI fingerprint.Quantity<?>
getQuantity
(String unitClassName) Return the Quantity for a given name of a unit class, or null if it has not been registered.void
Register the baseUnit in the UnitType registries.toString()
void
unregister
(Quantity<?> baseUnit) Unregister the baseUnit in the UnitType registries.
-
Field Details
-
INSTANCE
The one instance.
-
-
Method Details
-
register
Register the baseUnit in the UnitType registries.- Parameters:
quantity
- Quantity<?>; the quantity to register.
-
unregister
Unregister the baseUnit in the UnitType registries.- Parameters:
baseUnit
- Quantity<?>; the quantity to register.
-
getQuantities
Retrieve a safe copy of the quantity set registered for an SI fingerprint.- Parameters:
siDimensions
- SIDimensions; the SI dimensions to search for- Returns:
- a safe copy of the baseUnit set registered for this SI dimensions fingerprint
-
getQuantity
Return the Quantity for a given name of a unit class, or null if it has not been registered.- Parameters:
unitClassName
- String; the unit class name to search for, e.g., "LengthUnit"- Returns:
- Quantity; the quantity belonging to the class, or null if not found
-
getRegistry
- Returns:
- a defensive copy of the registry
-
toString
-