ANTAREX API

Clava API

LARA API

LARA Common Language API

(.js)
laraImport("lara.units.Unit");

(.lara)
import lara.units.Unit;

Unit

Constructor

Unit

new Unit()

Base class that represents a unit of what is being measured in ANTAREX, e.g., time or energy.

This should not be instantiated directly.


Instance Members

convert

convert(unit, value)

Converts the value, in the provided unit, to the unit this instance represents.

This presents a default implementation of the conversion assuming there is a factor table accessable throught the method _getFactorTable().

Parameters

unit: string -
value: any

getName

getName()

Returns the name of the unit.

This should not be called directly.