Package org.djunits.quantity.def
Class PerMass.Unit
- All Implemented Interfaces:
UnitInterface<PerMass>
- Enclosing class:
- PerMass
PerMass.Unit encodes the unit of the PerMass quantity.
Copyright (c) 2025-2026 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information https://djunits.org. The DJUNITS project is distributed under a three-clause BSD-style license.
- Author:
- Alexander Verbraeck
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final PerMass.Unitgram.static final PerMass.Unitper kilogram.static final PerMass.Unitmilligram.static final PerMass.Unitmicrogram.static final PerMass.UnitThe SI or BASE unit.static final SIUnitThe dimensions of mass: /kg. -
Constructor Summary
ConstructorsConstructorDescriptionUnit(String id, String name, double scaleFactorToBaseUnit, UnitSystem unitSystem) Create a new Mass unit.Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem, SIPrefix siPrefix) Return a derived unit for this unit, with textual abbreviation(s) and a display abbreviation. -
Method Summary
Modifier and TypeMethodDescriptionderiveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem, SIPrefix siPrefix) ofSi(double si, UnitInterface<PerMass> displayUnit) siUnit()Methods inherited from class org.djunits.unit.AbstractUnit
deriveUnit, equals, generateSiPrefixes, getDisplayAbbreviation, getId, getName, getScale, getSiPrefix, getStoredDisplayAbbreviation, getStoredName, getStoredTextualAbbreviation, getTextualAbbreviation, getUnitSystem, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.unit.UnitInterface
fromBaseValue, ofSi, quantityInUnit, toBaseValue
-
Field Details
-
SI_UNIT
The dimensions of mass: /kg. -
per_kg
per kilogram. -
SI
The SI or BASE unit. -
per_g
gram. -
per_mug
microgram. -
per_mg
milligram.
-
-
Constructor Details
-
Unit
Create a new Mass unit.- Parameters:
id- the id or main abbreviation of the unitname- the full name of the unitscaleFactorToBaseUnit- the scale factor of the unit to convert it TO the base (SI) unitunitSystem- the unit system such as SI or IMPERIAL
-
Unit
public Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem, SIPrefix siPrefix) Return a derived unit for this unit, with textual abbreviation(s) and a display abbreviation.- Parameters:
textualAbbreviation- the textual abbreviation of the unit, which doubles as the iddisplayAbbreviation- the display abbreviation of the unitname- the full name of the unitscale- the scale to use to convert from this unit to the standard (e.g., SI, BASE) unitunitSystem- unit system, e.g. SI or ImperialsiPrefix- the SI Prefix of this unit
-
-
Method Details
-
siUnit
-
getBaseUnit
-
ofSi
-
deriveUnit
public PerMass.Unit deriveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem, SIPrefix siPrefix) - Specified by:
deriveUnitin classAbstractUnit<PerMass>
-