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.
Instances of this class are created through the AbstractUnit#transform method.
| Modifier and Type | Field and Description |
|---|---|
| private final UnitConverter | converter
Holds the converter to the parent unit. |
| private final AbstractUnit | parentUnit
Holds the parent unit. |
| private static final long | |
| private final Unit | systemUnit
Holds the system unit. |
| Access | Constructor and Description |
|---|---|
| public | TransformedUnit(Unit<Q>
the system unit from which this unit is derived. parentUnit, UnitConverter unitConverter)Creates a transformed unit from the specified system unit. |
| public | TransformedUnit(String
the symbol to use with this transformed unit. symbol, String the name to use with this transformed unit. name, Unit<Q> the parent unit from which this unit is derived. parentUnit, UnitConverter the converter to the parent units. unitConverter)Creates a transformed unit from the specified parent unit. |
| public | TransformedUnit(String
the symbol to use with this transformed unit. symbol, Unit<Q> the parent unit from which this unit is derived. parentUnit, UnitConverter the converter to the parent units. unitConverter)Creates a transformed unit from the specified parent unit. |
| public | TransformedUnit(String
the symbol for this unit. symbol, String the name for this unit. name, Unit<Q> the parent unit from which this unit is derived. parentUnit, Unit<Q> the system unit which this unit is based on. sysUnit, UnitConverter unitConverter)Creates a transformed unit from the specified parent and system unit. |
| public | TransformedUnit(String
the symbol for this unit. symbol, Unit<Q> the parent unit from which this unit is derived. parentUnit, Unit<Q> the system unit which this unit is based on. sysUnit, UnitConverter unitConverter)Creates a transformed unit from the specified parent and system unit. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Implements abstract tech. Indicates whether some other object is "equal to" this one. |
| public Map | getBaseUnits()
Implements abstract tech. Implements javax. Returns the base units and their exponent whose product is this unit, or |
| public UnitConverter | Returns: the converter to the parent unit.Implements tech. Returns the converter to the parent unit. |
| public Dimension | getDimension()
Implements abstract tech. Implements javax. Returns the dimension of this unit. |
| public Unit | Returns: the untransformed unit from which this unit is derived.Returns the parent unit for this unit. |
| public UnitConverter | getSystemConverter()
Implements abstract tech. Returns the converter from this unit to its unscaled |
| public int | hashCode()
Implements abstract tech. Returns a hash code value for this object. |
| protected Unit | toSystemUnit()
Implements abstract tech. Returns the unscaled |
| converter | back to summary |
|---|---|
| private final UnitConverter converter Holds the converter to the parent unit. | |
| parentUnit | back to summary |
|---|---|
| private final AbstractUnit<Q> parentUnit Holds the parent unit. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| systemUnit | back to summary |
|---|---|
| private final Unit<Q> systemUnit Holds the system unit. | |
| TransformedUnit | back to summary |
|---|---|
| public TransformedUnit(Unit<Q> parentUnit, UnitConverter unitConverter) Creates a transformed unit from the specified system unit. using the parent as symbol
| |
| TransformedUnit | back to summary |
|---|---|
| public TransformedUnit(String symbol, String name, Unit<Q> parentUnit, UnitConverter unitConverter) Creates a transformed unit from the specified parent unit.
| |
| TransformedUnit | back to summary |
|---|---|
| public TransformedUnit(String symbol, Unit<Q> parentUnit, UnitConverter unitConverter) Creates a transformed unit from the specified parent unit.
| |
| TransformedUnit | back to summary |
|---|---|
| public TransformedUnit(String symbol, String name, Unit<Q> parentUnit, Unit<Q> sysUnit, UnitConverter unitConverter) Creates a transformed unit from the specified parent and system unit. using a specific symbol and name. | |
| TransformedUnit | back to summary |
|---|---|
| public TransformedUnit(String symbol, Unit<Q> parentUnit, Unit<Q> sysUnit, UnitConverter unitConverter) Creates a transformed unit from the specified parent and system unit. using a specific symbol. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract tech. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getBaseUnits | back to summary |
|---|---|
| public Map Implements abstract tech. Implements javax. Doc from javax. Returns the base units and their exponent whose product is this unit, or | |
| getConverter | back to summary |
|---|---|
| public UnitConverter getConverter() Implements tech. Returns the converter to the parent unit.
| |
| getDimension | back to summary |
|---|---|
| public Dimension getDimension() Implements abstract tech. Implements javax. Doc from javax. Returns the dimension of this unit. Two units | |
| getParentUnit | back to summary |
|---|---|
| public Unit Returns the parent unit for this unit. The parent unit is the untransformed unit from which this unit is derived.
| |
| getSystemConverter | back to summary |
|---|---|
| public UnitConverter getSystemConverter() Implements abstract tech. Doc from tech. Returns the converter from this unit to its unscaled
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract tech. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toSystemUnit | back to summary |
|---|---|
| protected Unit Implements abstract tech. Doc from tech. Returns the unscaled | |