Class TemperatureUnit

java.lang.Object
neqsim.util.unit.BaseUnit
neqsim.util.unit.TemperatureUnit
All Implemented Interfaces:
Serializable, ThermodynamicConstantsInterface, Unit

public class TemperatureUnit extends BaseUnit

TemperatureUnit class.

Version:
$Id: $Id
Author:
esol
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serialization version UID.
      See Also:
  • Constructor Details

    • TemperatureUnit

      public TemperatureUnit(double value, String name)

      Constructor for TemperatureUnit.

      Parameters:
      value - a double
      name - a String object
  • Method Details

    • getConversionFactor

      public double getConversionFactor(String name)
      Get conversion factor for temperature unit conversions to Kelvin. Note: This is primarily for understanding scale, not for direct conversions including offsets.
      Parameters:
      name - a String object representing the temperature unit
      Returns:
      a double representing the conversion factor relative to Kelvin
    • getValue

      public double getValue(double value, String fromUnit, String toUnit)

      Convert value from a specified unit to a specified unit.

      Specified by:
      getValue in interface Unit
      Overrides:
      getValue in class BaseUnit
      Parameters:
      value - a double
      fromUnit - a String object
      toUnit - a String object
      Returns:
      a double
    • getValue

      public double getValue(String toUnit)

      Get process value in specified unit.

      Convert a given temperature value from Kelvin to a specified unit.
      Specified by:
      getValue in interface Unit
      Overrides:
      getValue in class BaseUnit
      Parameters:
      toUnit - Unit to get process value in.
      Returns:
      Value converted to the specified unit.