Package org.openhab.core.library.unit
Class CurrencyUnit
java.lang.Object
org.openhab.core.library.unit.CurrencyUnit
- All Implemented Interfaces:
Serializable
,Comparable<javax.measure.Unit<Currency>>
,javax.measure.Unit<Currency>
,tech.uom.lib.common.function.Nameable
,tech.uom.lib.common.function.PrefixOperator<Currency>
,tech.uom.lib.common.function.SymbolSupplier
@NonNullByDefault({PARAMETER,RETURN_TYPE,FIELD,TYPE_BOUND})
public final class CurrencyUnit
extends Object
implements javax.measure.Unit<Currency>, Comparable<javax.measure.Unit<Currency>>, tech.uom.lib.common.function.PrefixOperator<Currency>, tech.uom.lib.common.function.Nameable, Serializable, tech.uom.lib.common.function.SymbolSupplier
The
CurrencyUnit
is a UoM compatible unit for currencies.- Author:
- Jan N. Klug - Initial contribution
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal javax.measure.Unit<Currency>
<T extends javax.measure.Quantity<T>>
javax.measure.Unit<T>int
javax.measure.Unit<Currency>
divide
(double divisor) final javax.measure.Unit<Currency>
final javax.measure.Unit<?>
divide
(javax.measure.Unit<?> that) boolean
final javax.measure.UnitConverter
getConverterTo
(javax.measure.Unit<Currency> that) final javax.measure.UnitConverter
getConverterToAny
(javax.measure.Unit<?> that) javax.measure.Dimension
getName()
@Nullable String
javax.measure.UnitConverter
javax.measure.Unit<Currency>
int
hashCode()
final javax.measure.Unit<?>
inverse()
boolean
isCompatible
(javax.measure.Unit<?> that) boolean
isEquivalentTo
(javax.measure.Unit<Currency> that) javax.measure.Unit<Currency>
multiply
(double multiplier) javax.measure.Unit<Currency>
final javax.measure.Unit<?>
multiply
(javax.measure.Unit<?> that) javax.measure.Unit<?>
pow
(int n) javax.measure.Unit<Currency>
prefix
(javax.measure.Prefix prefix) final javax.measure.Unit<?>
root
(int n) void
void
javax.measure.Unit<Currency>
shift
(double offset) javax.measure.Unit<Currency>
toString()
final javax.measure.Unit<Currency>
transform
(javax.measure.UnitConverter operation)
-
Constructor Details
-
CurrencyUnit
Create a newCurrency
- Parameters:
name
- 3-letter ISO-Codesymbol
- an (optional) symbol- Throws:
IllegalArgumentException
- if name is not valid
-
-
Method Details
-
getSystemConverter
public javax.measure.UnitConverter getSystemConverter() -
toString
-
getSystemUnit
- Specified by:
getSystemUnit
in interfacejavax.measure.Unit<Currency>
-
isCompatible
public boolean isCompatible(@NonNullByDefault({}) javax.measure.Unit<?> that) - Specified by:
isCompatible
in interfacejavax.measure.Unit<Currency>
-
asType
@NonNullByDefault({}) public <T extends javax.measure.Quantity<T>> javax.measure.Unit<T> asType(@NonNullByDefault({}) Class<T> type) - Specified by:
asType
in interfacejavax.measure.Unit<Currency>
-
getBaseUnits
- Specified by:
getBaseUnits
in interfacejavax.measure.Unit<Currency>
-
getDimension
public javax.measure.Dimension getDimension()- Specified by:
getDimension
in interfacejavax.measure.Unit<Currency>
-
setName
-
getName
- Specified by:
getName
in interfacetech.uom.lib.common.function.Nameable
- Specified by:
getName
in interfacejavax.measure.Unit<Currency>
-
getSymbol
- Specified by:
getSymbol
in interfacetech.uom.lib.common.function.SymbolSupplier
- Specified by:
getSymbol
in interfacejavax.measure.Unit<Currency>
-
setSymbol
-
getConverterTo
public final javax.measure.UnitConverter getConverterTo(@NonNullByDefault({}) javax.measure.Unit<Currency> that) throws javax.measure.UnconvertibleException - Specified by:
getConverterTo
in interfacejavax.measure.Unit<Currency>
- Throws:
javax.measure.UnconvertibleException
-
getConverterToAny
@NonNullByDefault({}) public final javax.measure.UnitConverter getConverterToAny(@NonNullByDefault({}) javax.measure.Unit<?> that) throws javax.measure.IncommensurableException, javax.measure.UnconvertibleException - Specified by:
getConverterToAny
in interfacejavax.measure.Unit<Currency>
- Throws:
javax.measure.IncommensurableException
javax.measure.UnconvertibleException
-
alternate
- Specified by:
alternate
in interfacejavax.measure.Unit<Currency>
-
transform
public final javax.measure.Unit<Currency> transform(@NonNullByDefault({}) javax.measure.UnitConverter operation) - Specified by:
transform
in interfacejavax.measure.Unit<Currency>
-
shift
- Specified by:
shift
in interfacejavax.measure.Unit<Currency>
-
multiply
- Specified by:
multiply
in interfacejavax.measure.Unit<Currency>
-
shift
- Specified by:
shift
in interfacejavax.measure.Unit<Currency>
-
multiply
- Specified by:
multiply
in interfacejavax.measure.Unit<Currency>
-
divide
- Specified by:
divide
in interfacejavax.measure.Unit<Currency>
-
multiply
public final javax.measure.Unit<?> multiply(@NonNullByDefault({}) javax.measure.Unit<?> that) - Specified by:
multiply
in interfacejavax.measure.Unit<Currency>
-
inverse
public final javax.measure.Unit<?> inverse()- Specified by:
inverse
in interfacejavax.measure.Unit<Currency>
-
divide
- Specified by:
divide
in interfacejavax.measure.Unit<Currency>
-
divide
public final javax.measure.Unit<?> divide(@NonNullByDefault({}) javax.measure.Unit<?> that) - Specified by:
divide
in interfacejavax.measure.Unit<Currency>
-
root
public final javax.measure.Unit<?> root(int n) - Specified by:
root
in interfacejavax.measure.Unit<Currency>
-
pow
public javax.measure.Unit<?> pow(int n) - Specified by:
pow
in interfacejavax.measure.Unit<Currency>
-
prefix
-
compareTo
- Specified by:
compareTo
in interfaceComparable<javax.measure.Unit<Currency>>
-
isEquivalentTo
- Specified by:
isEquivalentTo
in interfacejavax.measure.Unit<Currency>
-
equals
-
hashCode
public int hashCode()
-