Class TemperatureUnit

Hierarchy-Diagram

UML class diagram of TemperatureUnit
Legend
icon for a class in the UML class diagram class

Hierarchy

  • Unit
    • TemperatureUnit

Constructors

Properties

CELCIUS: TemperatureUnit = ...
FAHRENHEIT: TemperatureUnit = ...
KELVIN: TemperatureUnit = ...
RANKINE: TemperatureUnit = ...
UNITS: Map<string, Unit> = ...
UNIT_BASES: Map<string, string> = ...
UNKNOWN: Unit = ...

Accessors

  • get aliases(): string[]
  • Unit aliases

    Returns

    Alias names as array

    Returns string[]

Methods

  • Convert a value in the current unit to a target unit

    Returns

    Converted unit

    Type Parameters

    Parameters

    • value: T

      Value to convert

    • target: string | Unit

      Target unit

    Returns T

  • Convert a value from a specific unit to a target unit

    Returns

    Converted unit

    Type Parameters

    Parameters

    • value: T

      Value to convert

    • from: string | Unit

      Source unit

    • to: string | Unit

      Target unit

    Returns T

  • Find a unit by its name

    Returns

    Unit if found

    Parameters

    • name: string

      Unit name

    • Optional baseName: string

      Optional base name to specific result

    Returns Unit

  • Get a unit from JSON

    Returns

    Unit if found

    Type Parameters

    Parameters

    • json: any

      JSON object

    Returns T