squants.thermal

Temperature

sealed abstract class Temperature extends Quantity[Temperature] with BaseQuantity

Represents a quantity of temperature

Temperatures are somewhat unique in the world of quantities for a couple of reasons.

First, different units (scales) have different "zero" values. This means that these scales are not simple multiples of the others. There is also an "zero offset" that must be applied to conversions from one scale to another.

Second, temperatures are often quoted as though they were quantities, when in fact they are just points on a scale. Similar to a mile marker on a highway, the quantity represented is the number degrees (miles) from a specific epoch on the scale.

In fact an absolute quantity of thermodynamic temperature should be measured from absolute zero. Thus, kelvinDegrees, is the SI Base unit for temperature.

The other scales supported here, Celsius and Fahrenheit, are known as empirical scales.

Two conversion types are supported: Degrees and Scale. Degrees based conversions DO NOT adjust for the zero point. Thus 5 degrees C|K is the same amount of temperature as 9 degrees F.

Scale based conversions DO adjust for the zero offset. Thus 5 degrees C is the same as 41 degrees F on the thermometer.

When creating a temperature it is not important to consider these differences. It is also irrelevant when performing operation on temperatures in the same scale. However, when performing operations on two temperatures of different scales these factors do become important.

The Quantity.to(unit) and Quantity.in(unit) methods are implemented to use Scale conversions

The Ordered.compare method is implemented to use Scale conversions

The Quantity.plus and Quantity.minus methods are implemented to use Degree conversions. (This supports creating quantity ranges with Fahrenheit(60) +- Celsius(5)

The toDegrees(unit) methods are implemented to use Degree conversions.

Since

0.1

Linear Supertypes
BaseQuantity, Quantity[Temperature], Serializable, Serializable, Ordered[Temperature], Comparable[Temperature], AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Temperature
  2. BaseQuantity
  3. Quantity
  4. Serializable
  5. Serializable
  6. Ordered
  7. Comparable
  8. AnyRef
  9. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Temperature(value: Double)

    value

    the value of the temperature

    Attributes
    protected

Abstract Value Members

  1. abstract def valueUnit: TemperatureScale

    The Unit of Measure used for the quantity's underlying value

    The Unit of Measure used for the quantity's underlying value

    returns

    UnitOfMeasure[A]

    Definition Classes
    TemperatureQuantity

Concrete Value Members

  1. def !=(that: Temperature): Boolean

    Return boolean result of inequality between this and that

    Return boolean result of inequality between this and that

    that

    Quantity

    returns

    Boolean

    Definition Classes
    TemperatureQuantity
  2. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  3. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  4. final def ##(): Int

    Definition Classes
    AnyRef → Any
  5. def %(that: Temperature): Double

    Definition Classes
    Quantity
  6. def %(that: Double): Temperature

    Definition Classes
    Quantity
  7. def *(that: ThermalCapacity): energy.Energy

  8. def *(that: Double): Temperature

    Definition Classes
    Quantity
  9. def +(that: Temperature): Temperature

    Definition Classes
    Quantity
  10. def +-(that: Temperature): QuantityRange[Temperature]

    Definition Classes
    Quantity
  11. def -(that: Temperature): Temperature

    Definition Classes
    Quantity
  12. def /(that: Temperature): Double

    Definition Classes
    Quantity
  13. def /(that: Double): Temperature

    Definition Classes
    Quantity
  14. def /%(that: Temperature): (Double, Temperature)

    Definition Classes
    Quantity
  15. def /%(that: Double): (Temperature, Temperature)

    Definition Classes
    Quantity
  16. def <(that: Temperature): Boolean

    Definition Classes
    Ordered
  17. def <=(that: Temperature): Boolean

    Definition Classes
    Ordered
  18. def ==(that: Temperature): Boolean

    Returns boolean result of equality between this and that

    Returns boolean result of equality between this and that

    that

    Quantity

    returns

    Boolean

    Definition Classes
    TemperatureQuantity
  19. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  20. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  21. def >(that: Temperature): Boolean

    Definition Classes
    Ordered
  22. def >=(that: Temperature): Boolean

    Definition Classes
    Ordered
  23. def abs: Temperature

    Returns the absolute value of this Quantity

    Returns the absolute value of this Quantity

    returns

    Quantity

    Definition Classes
    Quantity
  24. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  25. def baseUnit: Kelvin.type

    Definition Classes
    TemperatureBaseQuantity
  26. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def compare(that: Temperature): Int

    Implements Ordered.

    Implements Ordered.compare

    that

    Quantity

    returns

    Int

    Definition Classes
    TemperatureQuantity → Ordered
  28. def compareTo(that: Temperature): Int

    Definition Classes
    Ordered → Comparable
  29. def divide(that: Temperature): Double

    Divide this quantity by a like quantity

    Divide this quantity by a like quantity

    that

    Quantity

    returns

    Double

    Definition Classes
    Quantity
  30. def divide(that: Double): Temperature

    Divide this quantity by some number

    Divide this quantity by some number

    that

    Double

    returns

    Quantity

    Definition Classes
    Quantity
  31. def divideAndRemainder(that: Temperature): (Double, Temperature)

    Returns a Pair that includes the result of divideToInteger and remainder

    Returns a Pair that includes the result of divideToInteger and remainder

    that

    Quantity

    returns

    (Double, Quantity)

    Definition Classes
    Quantity
  32. def divideAndRemainder(that: Double): (Temperature, Temperature)

    Returns a Pair that includes the result of divideToInteger and remainder

    Returns a Pair that includes the result of divideToInteger and remainder

    that

    Double

    returns

    (Quantity, Quantity)

    Definition Classes
    Quantity
  33. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  34. def equals(that: Any): Boolean

    Override of equals method

    Override of equals method

    that

    must be of matching value and unit

    returns

    Definition Classes
    Quantity → AnyRef → Any
  35. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  36. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  37. def hashCode(): Int

    Override of hashCode

    Override of hashCode

    returns

    Definition Classes
    Quantity → AnyRef → Any
  38. def in(unit: TemperatureScale): Temperature

  39. def in(unit: UnitOfMeasure[Temperature] with UnitConverter): Temperature

    Returns an equivalent Quantity boxed with the supplied Unit

    Returns an equivalent Quantity boxed with the supplied Unit

    This is really only useful for Quantity classes that box at the UOM level e.g. Temperature and currently Time

    unit

    UnitOfMeasure[A] with UnitConverter

    returns

    Quantity

    Definition Classes
    Quantity
  40. def inCelsius: Temperature

  41. def inFahrenheit: Temperature

  42. def inKelvin: Temperature

  43. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  44. def max(that: Temperature): Quantity[Temperature]

    Returns the max of this and that Quantity

    Returns the max of this and that Quantity

    that

    Quantity

    returns

    Quantity

    Definition Classes
    Quantity
  45. def min(that: Temperature): Quantity[Temperature]

    Returns the min of this and that Quantity

    Returns the min of this and that Quantity

    that

    Quantity

    returns

    Quantity

    Definition Classes
    Quantity
  46. def minus(that: Temperature): Temperature

    Subtract two like quantities

    Subtract two like quantities

    that

    Quantity

    returns

    Quantity

    Definition Classes
    TemperatureQuantity
  47. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  48. def negate: Temperature

    Returns the negative value of this Quantity

    Returns the negative value of this Quantity

    returns

    Quantity

    Definition Classes
    Quantity
  49. def notWithin(range: QuantityRange[Temperature]): Boolean

    Returns true if this value is not within (contains) the range

    Returns true if this value is not within (contains) the range

    range

    QuantityRange

    returns

    Boolean

    Definition Classes
    Quantity
  50. final def notify(): Unit

    Definition Classes
    AnyRef
  51. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  52. def plus(that: Temperature): Temperature

    Add two like quantities

    Add two like quantities

    that

    Quantity

    returns

    Quantity

    Definition Classes
    TemperatureQuantity
  53. def plusOrMinus(that: Temperature): QuantityRange[Temperature]

    Returns a QuantityRange representing the range for this value +- that

    Returns a QuantityRange representing the range for this value +- that

    that

    Quantity

    returns

    QuantityRange

    Definition Classes
    Quantity
  54. def remainder(that: Temperature): Double

    Returns the remainder of a division by a like quantity

    Returns the remainder of a division by a like quantity

    that

    Quantity

    returns

    Double

    Definition Classes
    Quantity
  55. def remainder(that: Double): Temperature

    Returns the remainder of a division by a number

    Returns the remainder of a division by a number

    that

    Quantity

    returns

    Quantity

    Definition Classes
    Quantity
  56. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  57. def times(that: Double): Temperature

    Multiply this quantity by some number

    Multiply this quantity by some number

    that

    Double

    returns

    Quantity

    Definition Classes
    Quantity
  58. def to(unit: TemperatureScale): Double

  59. def to(unit: UnitOfMeasure[Temperature] with UnitConverter): Double

    Returns a Double representing the quantity in terms of the supplied unit

    Returns a Double representing the quantity in terms of the supplied unit

    val d = Feet(3)
    (d to Inches) should be(36)
    unit

    UnitOfMeasure[A] with UnitConverter

    returns

    Double

    Definition Classes
    Quantity
  60. def to(that: Temperature): QuantityRange[Temperature]

    Returns a QuantityRange that goes from this to that

    Returns a QuantityRange that goes from this to that

    that

    Quantity

    returns

    QuantityRange

    Definition Classes
    Quantity
  61. def toCelsiusDegrees: Double

  62. def toCelsiusScale: Double

  63. def toDegrees(unit: TemperatureScale): Double

  64. def toFahrenheitDegrees: Double

  65. def toFahrenheitScale: Double

  66. def toKelvinDegrees: Double

  67. def toKelvinScale: Double

  68. def toScale(unit: TemperatureScale): Double

  69. def toString(unit: TemperatureScale): String

  70. def toString(): String

    Returns a string representing the quantity's value in valueUnits

    Returns a string representing the quantity's value in valueUnits

    returns

    String

    Definition Classes
    TemperatureQuantity → AnyRef → Any
  71. def toString(unit: UnitOfMeasure[Temperature] with UnitConverter): String

    Returns a string representing the quantity's value in the given unit

    Returns a string representing the quantity's value in the given unit

    unit

    UnitOfMeasure[A] with UnitConverter

    returns

    String

    Definition Classes
    Quantity
  72. def unary_-(): Temperature

    Definition Classes
    Quantity
  73. val value: Double

    the value of the temperature

    the value of the temperature

    Definition Classes
    TemperatureQuantity
  74. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  75. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  76. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  77. def within(range: QuantityRange[Temperature]): Boolean

    Returns true if this value is within (contains) the range

    Returns true if this value is within (contains) the range

    range

    QuantityRange

    returns

    Boolean

    Definition Classes
    Quantity

Inherited from BaseQuantity

Inherited from Quantity[Temperature]

Inherited from Serializable

Inherited from Serializable

Inherited from Ordered[Temperature]

Inherited from Comparable[Temperature]

Inherited from AnyRef

Inherited from Any

Ungrouped