Package org.djunits.unit
Class UnitTest.PerMass.Unit
java.lang.Object
org.djunits.unit.AbstractUnit<UnitTest.PerMass.Unit,UnitTest.PerMass>
org.djunits.unit.UnitTest.PerMass.Unit
- All Implemented Interfaces:
UnitInterface<UnitTest.PerMass.Unit,UnitTest.PerMass>
- Enclosing class:
- UnitTest.PerMass
static final class UnitTest.PerMass.Unit
extends AbstractUnit<UnitTest.PerMass.Unit,UnitTest.PerMass>
Unit for
UnitTest.PerMass (SI dimension: 1/kg). The base textual/display abbreviation is "/kg", and the base
name is "per kilogram" so that AbstractUnit.generateSiPrefixes(boolean, boolean) with
kilo=true, perUnit=true passes the guards and uses SIPrefixes.PER_KILO_PREFIXES.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final UnitTest.PerMass.UnitBase per-kilo unit (1/kg).(package private) static final UnitTest.PerMass.UnitHandle forUnitTest.PerMass.ofSi(double)after prefix generation.(package private) static final SIUnitSI dimensions of per-mass: 1/kg. -
Constructor Summary
ConstructorsConstructorDescriptionUnit(String id, String name, double scaleFactorToBaseUnit, UnitSystem unitSystem) Construct a PerMass unit with an explicit (linear) scale factor to BASE (1/kg).Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem) Construct a PerMass unit with explicit textual/display abbreviations and a providedScale. -
Method Summary
Modifier and TypeMethodDescriptionderiveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem) ofSi(double si) siUnit()Methods inherited from class org.djunits.unit.AbstractUnit
deriveUnit, equals, generateSiPrefixes, getDisplayAbbreviation, getId, getName, getScale, getSiPrefix, getStoredDisplayAbbreviation, getStoredName, getStoredTextualAbbreviation, getTextualAbbreviation, getUnitSystem, hashCode, setSiPrefix, setSiPrefix, setSiPrefixKilo, setSiPrefixPer, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.djunits.unit.UnitInterface
fromBaseValue, quantityInUnit, toBaseValue
-
Field Details
-
SI_UNIT
SI dimensions of per-mass: 1/kg. -
PER_KILOGRAM
Base per-kilo unit (1/kg). -
SI
Handle forUnitTest.PerMass.ofSi(double)after prefix generation.
-
-
Constructor Details
-
Unit
Unit(String id, String name, double scaleFactorToBaseUnit, UnitSystem unitSystem) Construct a PerMass unit with an explicit (linear) scale factor to BASE (1/kg).- Parameters:
id- String; textual abbreviation / id (e.g., "/kg", "/g")name- String; full name (e.g., "per kilogram", "per gram")scaleFactorToBaseUnit- double; numeric factor to convert to 1/kgunitSystem- UnitSystem; system of the unit (typically SI_DERIVED)
-
Unit
Unit(String textualAbbreviation, String displayAbbreviation, String name, Scale scale, UnitSystem unitSystem) Construct a PerMass unit with explicit textual/display abbreviations and a providedScale.- Parameters:
textualAbbreviation- String; textual abbreviation / iddisplayAbbreviation- String; display abbreviationname- String; full name of the unitscale- Scale; scale used to convert to/from BASE (1/kg)unitSystem- UnitSystem; system of the unit (typically SI_DERIVED)
-
-
Method Details
-
siUnit
-
getBaseUnit
-
ofSi
-
deriveUnit
public UnitTest.PerMass.Unit deriveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem) - Specified by:
deriveUnitin classAbstractUnit<UnitTest.PerMass.Unit,UnitTest.PerMass>
-