Q - The type of the quantity measured by this unit.public final class TransformedUnit<Q extends javax.measure.Quantity<Q>> extends AbstractUnit<Q> implements tec.uom.lib.common.function.UnitConverterSupplier
This class represents the units derived from other units using converters.
Examples of transformed units:
CELSIUS = KELVIN.shift(273.15);
FOOT = METRE.multiply(3048).divide(10000);
MILLISECOND = MILLI(SECOND);
Transformed units have no symbol. But like any other units, they may have labels attached to them (see
UnitFormat.label
Instances of this class are created through the AbstractUnit.transform(javax.measure.UnitConverter) method.
name, ONE, SYMBOL_TO_UNIT| Constructor and Description |
|---|
TransformedUnit(String symbol,
javax.measure.Unit<Q> parentUnit,
javax.measure.Unit<Q> sysUnit,
javax.measure.UnitConverter unitConverter)
Creates a transformed unit from the specified parent and system unit.
|
TransformedUnit(String symbol,
javax.measure.Unit<Q> parentUnit,
javax.measure.UnitConverter unitConverter)
Creates a transformed unit from the specified parent unit.
|
TransformedUnit(javax.measure.Unit<Q> parentUnit,
javax.measure.UnitConverter unitConverter)
Creates a transformed unit from the specified system unit.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Map<? extends javax.measure.Unit<?>,Integer> |
getBaseUnits() |
javax.measure.UnitConverter |
getConverter()
Returns the converter to the parent unit.
|
javax.measure.Dimension |
getDimension() |
javax.measure.Unit<Q> |
getParentUnit()
Returns the parent unit for this unit.
|
String |
getSymbol() |
javax.measure.UnitConverter |
getSystemConverter()
Returns the converter from this unit to its unscaled
System Unit unit. |
int |
hashCode() |
protected javax.measure.Unit<Q> |
toSystemUnit()
Returns the unscaled
SI unit from which this unit is derived. |
alternate, annotate, asType, compareTo, divide, divide, divide, getActualType, getConverterTo, getConverterToAny, getName, getSystemUnit, inverse, isCompatible, isSystemUnit, multiply, multiply, multiply, parse, pow, root, setName, setSymbol, shift, toString, transformpublic TransformedUnit(javax.measure.Unit<Q> parentUnit, javax.measure.UnitConverter unitConverter)
parentUnit - the system unit from which this unit is derived.converter - the converter to the parent units.public TransformedUnit(String symbol, javax.measure.Unit<Q> parentUnit, javax.measure.UnitConverter unitConverter)
symbol - the symbol to use with this transformed unit.parentUnit - the parent unit from which this unit is derived.unitConverter - the converter to the parent units.public TransformedUnit(String symbol, javax.measure.Unit<Q> parentUnit, javax.measure.Unit<Q> sysUnit, javax.measure.UnitConverter unitConverter)
parentUnit - the parent unit from which this unit is derived.sysUnit - the system unit which this unit is based on.converter - the converter to the parent units.public javax.measure.Dimension getDimension()
getDimension in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>getDimension in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public javax.measure.UnitConverter getSystemConverter()
AbstractUnitSystem Unit unit.getSystemConverter in class AbstractUnit<Q extends javax.measure.Quantity<Q>>getConverterTo(this.toSystemUnit())#toSIpublic javax.measure.UnitConverter getConverter()
getConverter in interface tec.uom.lib.common.function.UnitConverterSupplierprotected javax.measure.Unit<Q> toSystemUnit()
AbstractUnitSI unit from which this unit is derived.
The SI unit can be be used to identify a quantity given the unit. For example: static boolean isAngularVelocity(AbstractUnit> unit) {
return unit.toSystemUnit().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. toSystemUnit in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public Map<? extends javax.measure.Unit<?>,Integer> getBaseUnits()
getBaseUnits in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>getBaseUnits in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public int hashCode()
hashCode in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public boolean equals(Object obj)
equals in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public javax.measure.Unit<Q> getParentUnit()
Copyright © 2005–2017 Units of Measurement project. All rights reserved.