Density class final

A quantity representing volumetric mass density (mass per unit volume).

Inheritance

Constructors

Density(double value, UnitOfMeasure<Density> unit)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toGramsPerCubicCentimeter Density
Converts this to grams per cubic centimeter (g/cm³).
no setter
toKilogramsPerCubicFoot Density
Converts this to kilograms per cubic foot (kg/ft³).
no setter
toKilogramsPerCubicMeter Density
Converts this to kilograms per cubic meter (kg/m³).
no setter
toKilogramsPerLiter Density
Converts this to kilograms per liter (kg/L).
no setter
toPoundsPerCubicFoot Density
Converts this to pounds per cubic foot (lb/ft³).
no setter
toPoundsPerCubicInch Density
Converts this to pounds per cubic inch (lb/in³).
no setter
unit UnitOfMeasure<Density>
The unit of measure that value is expressed in.
finalinherited
value double
The raw numeric value of this quantity expressed in unit.
finalinherited

Methods

equivalentTo(Quantity<Density> other) bool
Returns true if this quantity represents the same physical magnitude as other, regardless of which unit each is expressed in.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
to(UnitOfMeasure<Density> uom) double
Converts this quantity to uom and returns the raw double value.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator +(Density that) Density
Returns the sum of this quantity and that, expressed in unit.
inherited
operator -(Density that) Density
Returns the difference of this quantity and that, expressed in unit.
inherited
operator <(Density that) bool
Returns true if this quantity is less than that.
inherited
operator <=(Density that) bool
Returns true if this quantity is less than or equal to that.
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator >(Density that) bool
Returns true if this quantity is greater than that.
inherited
operator >=(Density that) bool
Returns true if this quantity is greater than or equal to that.
inherited

Static Methods

parse(String s) → Option<Density>
Parses s into a Density, returning None if parsing fails.
override

Constants

gramsPerCubicCentimeter → const DensityUnit
Unit for grams per cubic centimeter (g/cm³).
kilogramsPerCubicFoot → const DensityUnit
Unit for kilograms per cubic foot (kg/ft³).
kilogramsPerCubicMeter → const DensityUnit
Unit for kilograms per cubic meter (kg/m³) — the SI unit of density.
kilogramsPerLiter → const DensityUnit
Unit for kilograms per liter (kg/L).
poundsPerCubicFoot → const DensityUnit
Unit for pounds per cubic foot (lb/ft³).
poundsPerCubicInch → const DensityUnit
Unit for pounds per cubic inch (lb/in³).
units → const Set<DensityUnit>
All supported Density units.