public final class MixedUnit<Q extends javax.measure.Quantity<Q>> extends Object implements javax.measure.Unit<Q>
This class represents multi-radix units (such as "hour:min:sec" or "ft, in"). Instances of this class are created using the Unit.mix method.
Examples of mixed units: Unit
| Constructor and Description |
|---|
MixedUnit(javax.measure.Unit<Q> up,
javax.measure.Unit<Q> low)
Creates a mixed unit from the specified units.
|
| Modifier and Type | Method and Description |
|---|---|
javax.measure.Unit<Q> |
alternate(String symbol) |
<T extends javax.measure.Quantity<T>> |
asType(Class<T> type) |
javax.measure.Unit<Q> |
divide(double divisor) |
javax.measure.Unit<Q> |
divide(Number divisor) |
javax.measure.Unit<?> |
divide(javax.measure.Unit<?> divisor) |
boolean |
equals(Object obj)
Indicates if this mixed unit is considered equals to the specified object (both are mixed units with same composing units in the same
order).
|
Map<? extends javax.measure.Unit<?>,Integer> |
getBaseUnits() |
javax.measure.UnitConverter |
getConverterTo(javax.measure.Unit<Q> that) |
javax.measure.UnitConverter |
getConverterToAny(javax.measure.Unit<?> that) |
javax.measure.Dimension |
getDimension() |
javax.measure.Unit<Q> |
getLower()
Returns the lower unit of this mixed unit.
|
String |
getName() |
String |
getSymbol() |
javax.measure.Unit<Q> |
getSystemUnit() |
javax.measure.Unit<Q> |
getUpper()
Returns the upper unit of this mixed unit.
|
int |
hashCode() |
javax.measure.Unit<?> |
inverse() |
boolean |
isCompatible(javax.measure.Unit<?> that) |
boolean |
isEquivalentTo(javax.measure.Unit<Q> that) |
javax.measure.Unit<Q> |
mix(javax.measure.Unit<Q> that) |
javax.measure.Unit<Q> |
multiply(double multiplier) |
javax.measure.Unit<Q> |
multiply(Number multiplier) |
javax.measure.Unit<?> |
multiply(javax.measure.Unit<?> multiplier) |
javax.measure.Unit<?> |
pow(int n) |
javax.measure.Unit<Q> |
prefix(javax.measure.Prefix prefix) |
javax.measure.Unit<?> |
root(int n) |
javax.measure.Unit<Q> |
shift(double offset) |
javax.measure.Unit<Q> |
shift(Number offset) |
String |
toString()
Returns the standard representation of this physics unit.
|
javax.measure.Unit<Q> |
transform(javax.measure.UnitConverter operation) |
public MixedUnit(javax.measure.Unit<Q> up, javax.measure.Unit<Q> low)
up - the upper unit.low - the lower unit(s)IllegalArgumentException - if both units do not the same system unit.public javax.measure.Unit<Q> getLower()
public javax.measure.Unit<Q> getUpper()
public boolean equals(Object obj)
public javax.measure.Unit<Q> getSystemUnit()
public javax.measure.Dimension getDimension()
public Map<? extends javax.measure.Unit<?>,Integer> getBaseUnits()
public boolean isCompatible(javax.measure.Unit<?> that)
public <T extends javax.measure.Quantity<T>> javax.measure.Unit<T> asType(Class<T> type) throws ClassCastException
asType in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>ClassCastExceptionpublic javax.measure.UnitConverter getConverterTo(javax.measure.Unit<Q> that) throws javax.measure.UnconvertibleException
public javax.measure.UnitConverter getConverterToAny(javax.measure.Unit<?> that) throws javax.measure.IncommensurableException, javax.measure.UnconvertibleException
public javax.measure.Unit<?> multiply(javax.measure.Unit<?> multiplier)
public javax.measure.Unit<?> inverse()
public javax.measure.Unit<?> divide(javax.measure.Unit<?> divisor)
public javax.measure.Unit<?> root(int n)
public javax.measure.Unit<?> pow(int n)
public String toString()
LocalUnitFormat
in subclasses of AbstractUnit.public boolean isEquivalentTo(javax.measure.Unit<Q> that)
Copyright © 2005–2024 Units of Measurement project. All rights reserved.