Class Index | File Index

Classes


Class EnergyUnit


Extends Measurement.
Create a new energy measurement instance.
Defined in: EnergyUnit.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
EnergyUnit(options)
Method Summary
Method Attributes Method Name and Description
<static>  
EnergyUnit.convert(to, from, energy)
Convert a energy to another measure.
 
Return the type of this measurement.
 
newUnit(params)
Return a new instance of this type of measurement.
Class Detail
EnergyUnit(options)
Parameters:
options
{{unit:string,amount:number|string|undefined}} Options controlling the construction of this instance
Method Detail
<static> {number|undefined} EnergyUnit.convert(to, from, energy)
Convert a energy to another measure.
Parameters:
to
{string} unit to convert to
from
{string} unit to convert from
energy
{number} amount to be convert
Returns:
{number|undefined} the converted amount

{string} getMeasure()
Return the type of this measurement. Examples are "mass", "length", "speed", etc. Measurements can only be converted to measurements of the same type.

The type of the units is determined automatically from the units. For example, the unit "grams" is type "mass". Use the static call Measurement.getAvailableUnits to find out what units this version of ilib supports.

Returns:
{string} the name of the type of this measurement

{Measurement} newUnit(params)
Return a new instance of this type of measurement.
Parameters:
{Object} params
parameters to the constructor
Returns:
{Measurement} a measurement subclass instance

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jan 17 2023 15:56:28 GMT-0800 (Pacific Standard Time)