public class DensityUnit extends LinearUnit<DensityUnit>
Copyright (c) 2015-2019 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2019-03-02 19:06:46 +0100 (Sat, 02 Mar 2019) $, @version $Revision: 342 $, by $Author: averbraeck $,
initial version May 15, 2014
Modifier and Type | Field and Description |
---|---|
static DensityUnit |
GRAM_PER_CENTIMETER_3
g/cm^3.
|
static DensityUnit |
KG_PER_METER_3
kg/m^3.
|
static DensityUnit |
SI
The SI unit for standard density is kg/m^3.
|
STANDARD_UNITS
Constructor and Description |
---|
DensityUnit(MassUnit massUnit,
LengthUnit lengthUnit,
String name,
String abbreviation,
UnitSystem unitSystem)
Define user defined density unit based on mass and length.
|
DensityUnit(String name,
String abbreviation,
UnitSystem unitSystem,
DensityUnit referenceUnit,
double scaleFactorToReferenceUnit)
Build a user-defined unit with a conversion factor to another unit.
|
Modifier and Type | Method and Description |
---|---|
LengthUnit |
getLengthUnit() |
MassUnit |
getMassUnit() |
String |
getSICoefficientsString() |
DensityUnit |
getStandardUnit() |
equals, equalsIgnoreNaming, getScale, getScaleFactor, hashCode
generateHashCode, getAbbreviation, getAbbreviationKey, getAllUnitsOfThisType, getDefaultLocaleAbbreviation, getDefaultLocaleName, getDefaultLocaleTextualRepresentation, getDefaultLocaleTextualRepresentations, getDefaultTextualRepresentation, getName, getSICoefficients, getTextualRepresentations, getUnits, getUnitSystem, isBaseSIUnit, isLocalizable, lookupOrCreateSIUnitWithSICoefficients, lookupOrCreateUnitWithSICoefficients, lookupUnitWithSICoefficients, toString
public static final DensityUnit SI
public static final DensityUnit KG_PER_METER_3
public static final DensityUnit GRAM_PER_CENTIMETER_3
public DensityUnit(MassUnit massUnit, LengthUnit lengthUnit, String name, String abbreviation, UnitSystem unitSystem)
massUnit
- MassUnit; the unit of mass for the density unit, e.g., kglengthUnit
- LengthUnit; the unit of length for the density unit, e.g., metername
- String; the long name of the unitabbreviation
- String; the abbreviation of the unitunitSystem
- UnitSystem; the unit system, e.g. SI or Imperialpublic DensityUnit(String name, String abbreviation, UnitSystem unitSystem, DensityUnit referenceUnit, double scaleFactorToReferenceUnit)
name
- String; the long name of the unitabbreviation
- String; the abbreviation of the unitunitSystem
- UnitSystem; the unit system, e.g. SI or ImperialreferenceUnit
- DensityUnit; the unit to convert toscaleFactorToReferenceUnit
- double; multiply a value in this unit by the factor to convert to the given reference
unitpublic final MassUnit getMassUnit()
public final LengthUnit getLengthUnit()
public final DensityUnit getStandardUnit()
getStandardUnit
in class Unit<DensityUnit>
public final String getSICoefficientsString()
getSICoefficientsString
in class Unit<DensityUnit>
Copyright © 2015–2019 Delft University of Technology. All rights reserved.