Temperature class

A unit of measurement representing a temperature.

Inheritance

Constructors

Temperature.fromCelsius(Rational celsius)
Creates a Temperature representing the specified number of celsius.
factory
Temperature.fromCentikelvins(Rational centikelvins)
Creates a Temperature representing the specified number of centikelvins.
factory
Temperature.fromDecikelvins(Rational decikelvins)
Creates a Temperature representing the specified number of decikelvins.
factory
Temperature.fromFahrenheit(Rational fahrenheit)
Creates a Temperature representing the specified number of fahrenheit.
factory
Temperature.fromKelvins(Rational kelvins)
Creates a Temperature representing the specified number of kelvins.
factory
Temperature.fromMicrokelvins(Rational microkelvins)
Creates a Temperature representing the specified number of microkelvins.
factory
Temperature.fromMillikelvins(Rational millikelvins)
Creates a Temperature representing the specified number of millikelvins.
factory
Temperature.fromNanokelvins(Rational nanokelvins)
Creates a Temperature representing the specified number of nanokelvins.
factory
Temperature.fromUnits(TemperatureUnit unit, Rational value)
Creates a Temperature given a unit and rational value for that unit.

Properties

baseValue ↔ Rational
The underlying base value of the unit of measurement.
latefinalinherited
celsius → Rational
Gets the number of celsius in this Temperature, including the fractional portion.
no setter
centikelvins → Rational
Gets the number of centikelvins in this Temperature, including the fractional portion.
no setter
decikelvins → Rational
Gets the number of decikelvins in this Temperature, including the fractional portion.
no setter
fahrenheit → Rational
Gets the number of fahrenheit in this Temperature, including the fractional portion.
no setter
hashCode int
The hash code for this object.
no setterinherited
kelvins → Rational
Gets the number of kelvins in this Temperature, including the fractional portion.
no setter
microkelvins → Rational
Gets the number of microkelvins in this Temperature, including the fractional portion.
no setter
millikelvins → Rational
Gets the number of millikelvins in this Temperature, including the fractional portion.
no setter
nanokelvins → Rational
Gets the number of nanokelvins in this Temperature, including the fractional portion.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

abs() Temperature
Gets the absolute value.
inherited
compareTo(Temperature other) int
Compares this object to another object.
inherited
createValue(Rational baseValue) Temperature
Creates a unit of measurement value with the specified baseValue.
override
getBaseValue(TemperatureUnit unit, Rational value) → Rational
Gets the base value for a unit of measurement of unit and value.
override
getLargestUnit({required Set<TemperatureUnit> permissibleUnits}) TemperatureUnit
Determines the largest unit that has a value of at least 1.
inherited
getUnits(TemperatureUnit unit) → Rational
Gets the number of unit units in this unit of measurement.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
per(Duration period) TemperatureRate
Creates a TemperatureRate with the specified period from this value.
round(TemperatureUnit roundTo) Temperature
Rounds this unit of measurement such that the roundTo unit will be rounded towards the nearest integer.
inherited
toString() String
A string representation of this object.
override

Operators

operator *(Rational factor) Temperature
Multiplies this value by factor.
inherited
operator +(Temperature other) Temperature
Adds other onto this value.
inherited
operator -(Temperature other) Temperature
Subtracts other from this value.
inherited
operator /(Rational divisor) Temperature
Divides this value by divisor.
inherited
operator <(Temperature other) bool
Determines whether this value is less than other.
inherited
operator <=(Temperature other) bool
Determines whether this value is less than or equal to other.
inherited
operator ==(Object other) bool
Determines whether this unit of measurement value is equal to other.
inherited
operator >(Temperature other) bool
Determines whether this value is greater than other.
inherited
operator >=(Temperature other) bool
Determines whether this value is greater than or equal to other.
inherited
operator unary-() Temperature
Negates this value.
inherited

Static Properties

zero Temperature
A Temperature of zero kelvins.
final