Class PowerUnit

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

public class PowerUnit extends BaseUnit

PowerUnit class for converting between different power units.

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

  • Constructor Details

    • PowerUnit

      public PowerUnit(double value, String unit)
      Constructor for PowerUnit.
      Parameters:
      value - power value
      unit - engineering unit of value
  • Method Details

    • getConversionFactor

      public double getConversionFactor(String name)
      Get conversion factor to Watts (SI unit).
      Parameters:
      name - unit name
      Returns:
      conversion factor to Watts
    • getValue

      public double getValue(double val, 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:
      val - 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.

      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.