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 all other units, they may have labels attached to them (see
UnitFormat.label(Unit, String)
Instances of this class are created through the AbstractUnit.transform(javax.measure.UnitConverter) method.
name, ONE| Constructor and Description |
|---|
TransformedUnit(AbstractUnit<Q> parentUnit,
javax.measure.UnitConverter unitConverter)
Creates a transformed unit from the specified system unit.
|
TransformedUnit(String symbol,
javax.measure.Unit<Q> parentUnit,
javax.measure.UnitConverter unitConverter)
Creates a transformed unit from the specified system unit.
|
TransformedUnit(javax.measure.Unit<Q> parentUnit,
javax.measure.UnitConverter toParentUnit)
Creates a transformed unit from the specified system unit.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object that) |
Map<? extends javax.measure.Unit<?>,Integer> |
getBaseUnits() |
javax.measure.UnitConverter |
getConverter() |
javax.measure.Dimension |
getDimension() |
javax.measure.Unit<Q> |
getParentUnit() |
String |
getSymbol() |
javax.measure.UnitConverter |
getSystemConverter()
Returns the converter from this unit to its unscaled
standard unit. |
int |
hashCode() |
AbstractUnit<Q> |
toSystemUnit()
Returns the unscaled standard (SI) unit from which this unit is derived.
|
alternate, annotate, asType, compareTo, divide, divide, getConverterTo, getConverterToAny, getName, getSystemUnit, inverse, isCompatible, isSystemUnit, multiply, multiply, multiply, parse, pow, root, setName, setSymbol, shift, toString, transformpublic TransformedUnit(AbstractUnit<Q> parentUnit, javax.measure.UnitConverter unitConverter)
parentUnit - the system unit from which this unit is derived.unitConverter - the converter to the parent units.IllegalArgumentException - if the specified parent unit is not an system unitpublic TransformedUnit(String symbol, javax.measure.Unit<Q> parentUnit, javax.measure.UnitConverter unitConverter)
parentUnit - the system unit from which this unit is derived.unitConverter - the converter to the parent units.IllegalArgumentException - if the specified parent unit is not an system unitpublic TransformedUnit(javax.measure.Unit<Q> parentUnit, javax.measure.UnitConverter toParentUnit)
parentUnit - the system unit from which this unit is derived.toParentUnit - the converter to the parent units.IllegalArgumentException - if the specified parent unit is not an system unitClassCastException - if parentUnit is not a valid Unit implementationpublic 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()
AbstractUnitstandard unit.getSystemConverter in class AbstractUnit<Q extends javax.measure.Quantity<Q>>getConverterTo(this.toSystemUnit())AbstractUnit.toSystemUnit()public AbstractUnit<Q> toSystemUnit()
AbstractUnit 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 that)
equals in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public javax.measure.Unit<Q> getParentUnit()
public javax.measure.UnitConverter getConverter()
getConverter in interface tec.uom.lib.common.function.UnitConverterSupplierCopyright © 2005–2016 Jean-Marie Dautelle, Werner Keil, V2COM. All rights reserved.