public class DensityUnit extends LinearUnit<DensityUnit>
Copyright (c) 2015-2018 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See DJUNITS License.
$LastChangedDate: 2018-01-28 03:17:44 +0100 (Sun, 28 Jan 2018) $, @version $Revision: 256 $, 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, getName, getNameKey, getSICoefficients, 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
- the unit of mass for the density unit, e.g., kglengthUnit
- the unit of length for the density unit, e.g., metername
- the long name of the unitabbreviation
- the abbreviation of the unitunitSystem
- the unit system, e.g. SI or Imperialpublic DensityUnit(String name, String abbreviation, UnitSystem unitSystem, DensityUnit referenceUnit, double scaleFactorToReferenceUnit)
name
- the long name of the unitabbreviation
- the abbreviation of the unitunitSystem
- the unit system, e.g. SI or ImperialreferenceUnit
- the unit to convert toscaleFactorToReferenceUnit
- 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–2018 Delft University of Technology. All rights reserved.