public final class AlternateUnit<Q extends javax.measure.Quantity<Q>> extends AbstractUnit<Q>
This class represents units used in expressions to distinguish between quantities of a different nature but of the same dimensions.
name, ONE| Constructor and Description |
|---|
AlternateUnit(AbstractUnit<?> parentUnit,
String symbol)
Creates an alternate unit for the specified system unit identified by the specified name and symbol.
|
AlternateUnit(javax.measure.Unit<?> parentUnit,
String symbol)
Creates an alternate unit for the specified system unit identified by the specified name and symbol.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Map<? extends javax.measure.Unit<?>,Integer> |
getBaseUnits() |
javax.measure.Dimension |
getDimension() |
AbstractUnit<?> |
getParentUnit()
Returns the parent unit of this alternate unit, always a system unit and never an alternate unit.
|
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 AlternateUnit(AbstractUnit<?> parentUnit, String symbol)
parent - the system unit from which this alternate unit is derived.symbol - the symbol for this alternate unit.IllegalArgumentException - if the specified parent unit is not an system unitpublic AlternateUnit(javax.measure.Unit<?> parentUnit, String symbol)
parent - the system unit from which this alternate unit is derived.symbol - the symbol for this alternate unit.IllegalArgumentException - if the specified parent unit is not an system unitClassCastException - if parentUnit is not a valid Unit implementationpublic AbstractUnit<?> getParentUnit()
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()
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>>Copyright © 2005–2016 Jean-Marie Dautelle, Werner Keil, V2COM. All rights reserved.