Class Temperature

java.lang.Object
ome.units.quantity.Quantity
ome.units.quantity.Temperature
All Implemented Interfaces:
Comparable<Temperature>

public class Temperature extends Quantity implements Comparable<Temperature>
Temperature quantity.
Since:
5.1
  • Constructor Details

    • Temperature

      public Temperature(Number inValue, Unit<Temperature> inUnit)
      Create an Temperature.
      Parameters:
      inValue - the value.
      inUnit - the unit type.
  • Method Details

    • value

      public Number value()
      Description copied from class: Quantity
      Get the numerical value of this quantity.
      Specified by:
      value in class Quantity
      Returns:
      the value.
    • value

      public Number value(Unit<Temperature> inUnit)
      Perform a unit conversion.
      Parameters:
      inUnit - the unit to convert to.
      Returns:
      the current quantity value converted to the specified unit, or null if the conversion is not possible.
    • equals

      public boolean equals(Object other)
      Check quantities for equality. Unit conversion will be performed when required to convert into the unit system of this quantity in order to perform the comparison. Note that floating point comparison is dangerous. Do not use this method.
      Overrides:
      equals in class Object
      Returns:
      true if equal, false if not equal.
    • compareTo

      public int compareTo(Temperature other)
      Check quantities for equality. Unit conversion will be performed when required to convert into the unit system of this quantity in order to perform the comparison. Note that floating point comparison is dangerous. Do not use this method.
      Specified by:
      compareTo in interface Comparable<Temperature>
      Returns:
      true if equal, false if not equal.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • unit

      public Unit<Temperature> unit()
      Description copied from class: Quantity
      Get the unit for this quantity.
      Specified by:
      unit in class Quantity
      Returns:
      the unit.