Class BaseUnit

java.lang.Object
neqsim.util.unit.BaseUnit
All Implemented Interfaces:
Serializable, ThermodynamicConstantsInterface, Unit
Direct Known Subclasses:
EnergyUnit, LengthUnit, PowerUnit, PressureUnit, RateUnit, TemperatureUnit, TimeUnit

public abstract class BaseUnit extends Object implements Unit, ThermodynamicConstantsInterface

BaseUnit class.

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

    • serialVersionUID

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

      protected double SIvalue
      Process value in SI units
    • invalue

      protected double invalue
      Process value in given unit
    • inunit

      protected String inunit
      Unit of process value
    • factor

      protected double factor
      Conversion factor
  • Constructor Details

    • BaseUnit

      public BaseUnit(double value, String name)

      Constructor for BaseUnit.

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

    • getSIvalue

      public double getSIvalue()

      getSIvalue.

      Specified by:
      getSIvalue in interface Unit
      Returns:
      a double
    • 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
      Parameters:
      val - a double
      fromunit - a String object
      tounit - a String object
      Returns:
      a double
    • getValue

      public double getValue(String fromunit)

      Get process value in specified unit.

      Specified by:
      getValue in interface Unit
      Parameters:
      fromunit - Unit to get process value in.
      Returns:
      Value converted to the specified unit.