public interface GUnit
Modifier and Type | Method and Description |
---|---|
BigDecimal |
convertFromMemory(BigDecimal value)
Converts the value from the memory unit.
|
double |
convertFromMemory(double value)
Converts the value from the memory unit.
|
BigDecimal |
convertToMemory(BigDecimal value)
Converts the value to the memory unit.
|
double |
convertToMemory(double value)
Converts the value to the memory unit.
|
BigDecimal |
convertToUnit(BigDecimal value,
GUnit destUnit)
Converts the units of value to unit.
|
double |
convertToUnit(double value,
GUnit destUnit)
Converts the units of value to unit.
|
String |
getCompactedName()
Returns the name of the unit decomposed in basicUnits, without multipliers and sorted.
|
String |
getName()
Get the string representing the unit name.
|
boolean |
isCompatible(GUnit unit)
Determines if unit is compatible with the GUnit object.
|
boolean |
isValidUnitName(String unitName)
Verify if a unit name string represents a valid unit.
|
boolean isValidUnitName(String unitName)
unitName
- unit name string to test.boolean isCompatible(GUnit unit)
unit
- to check if it is compatible.BigDecimal convertToUnit(BigDecimal value, GUnit destUnit) throws GException
value
- to convert.destUnit
- the destination unit.GException
- in case of an error performing the conversion.double convertToUnit(double value, GUnit destUnit) throws GException
value
- to convert.destUnit
- the destination unit.GException
- in case of an error performing the conversion.BigDecimal convertToMemory(BigDecimal value)
value
- to convert.double convertToMemory(double value)
value
- to convert.BigDecimal convertFromMemory(BigDecimal value)
value
- to convert.double convertFromMemory(double value)
value
- to convert.String getName()
String getCompactedName()
Copyright © 2024. All rights reserved.