API / geotoolkit / util / AbstractUnit / AbstractUnit
util.AbstractUnit.AbstractUnit
An interface that represents an unit
AbstractUnit↳
Unit
Constructors
Methods
Methods
▸ Abstract belongsTo(type): boolean
Check if the unit belongs to the type(s)
| Name | Type | Description |
|---|---|---|
type | string | string[] | quantity type(s) to be tested |
boolean
result
▸ Abstract canConvertTo(other): boolean
Check if a unit can be converted from the current unit
| Name | Type | Description |
|---|---|---|
other | string | AbstractUnit | unit to be converted |
boolean
true if a unit can be converted from the specific unit
▸ Abstract convert(value, other): number
Convert the value to a specific unit if canConvertTo
| Name | Type | Description |
|---|---|---|
value | number | value to be converted |
other | string | AbstractUnit | other unit to be converted |
number
converted
▸ Abstract convert(value, other): number[]
| Name | Type |
|---|---|
value | number[] |
other | string | AbstractUnit |
number[]
▸ Abstract convert(value, other): number | number[]
| Name | Type |
|---|---|
value | number | number[] |
other | string | AbstractUnit |
number | number[]
▸ Abstract fromBaseUnit(value): number
Convert unit value from base unit
| Name | Type | Description |
|---|---|---|
value | number | value to be converted |
number
converted
▸ Abstract getBaseUnitSymbol(): string
Returns base unit symbol
string
base unit symbol
▸ getClassName(): string
string
▸ Abstract getDescription(): string
Returns unit description
string
unit name
▸ Abstract getName(): string
Returns unit name
string
unit name
▸ getProperties(): Record<string, any>
Gets the properties
Record<string, any>
props properties
▸ Abstract getQuantityType(): string[]
get the Quantity types of the unit
string[]
quantity types
▸ Abstract getSymbol(): string
Unit symbol
string
unit symbol
▸ Abstract sameAs(other): boolean
Compares this unit with another unit
| Name | Type |
|---|---|
other | string | AbstractUnit |
boolean
▸ setProperties(props?): AbstractUnit
Sets the properties
| Name | Type | Description |
|---|---|---|
Optional props | Record<string, any> | properties |
this
▸ Abstract toBaseUnit(value): number
Convert unit value to base unit
| Name | Type | Description |
|---|---|---|
value | number | value to be converted |
number
converted
▸ Static getClassName(): string
string