Package org.djunits.unit
Class UnitTest.PerMass.Unit
- All Implemented Interfaces:
UnitInterface<UnitTest.PerMass>
- Enclosing class:
- 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, 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<UnitTest.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
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, 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 UnitTest.PerMass.Unit deriveUnit(String textualAbbreviation, String displayAbbreviation, String name, double scaleFactor, UnitSystem unitSystem, SIPrefix siPrefix) - Specified by:
deriveUnitin classAbstractUnit<UnitTest.PerMass>
-