public final class BaseUnit<Q extends javax.measure.Quantity<Q>> extends AbstractUnit<Q>
This class represents the building blocks on top of which all others physical units are created. Base units are always unscaled SI units.
When using the standard model,
all seven SI base units are dimensionally independent.
AbstractUnit.Equalizername, ONE, SYMBOL_TO_UNIT| Constructor and Description |
|---|
BaseUnit(String symbol)
Creates a base unit having the specified symbol.
|
BaseUnit(String symbol,
javax.measure.Dimension dimension)
Creates a base unit having the specified symbol and dimension.
|
BaseUnit(String symbol,
String name)
Creates a base unit having the specified symbol and name.
|
BaseUnit(String symbol,
String name,
javax.measure.Dimension dimension)
Creates a base unit having the specified symbol, name and dimension.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Map<? extends AbstractUnit<Q>,Integer> |
getBaseUnits() |
javax.measure.Dimension |
getDimension() |
javax.measure.UnitConverter |
getSystemConverter()
Returns the converter from this unit to its unscaled
System Unit unit. |
int |
hashCode() |
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, getSymbol, getSystemUnit, internalGetConverterTo, inverse, isCompatible, isEquivalentTo, isSystemUnit, multiply, multiply, multiply, parse, pow, prefix, root, setName, setSymbol, shift, shift, toString, transformpublic BaseUnit(String symbol, javax.measure.Dimension dimension)
symbol - the symbol of this base unit.public BaseUnit(String symbol)
symbol - the symbol of this base unit.public BaseUnit(String symbol, String name)
symbol - the symbol of this base unit.name - the name of this base unit.IllegalArgumentException - if the specified symbol is associated to a
different unit.public BaseUnit(String symbol, String name, javax.measure.Dimension dimension)
symbol - the symbol of this base unit.name - the name of this base unit.IllegalArgumentException - if the specified symbol is associated to a
different unit.public 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 javax.measure.UnitConverter getSystemConverter() throws UnsupportedOperationException
AbstractUnitSystem Unit unit.getSystemConverter in class AbstractUnit<Q extends javax.measure.Quantity<Q>>getConverterTo(this.toSystemUnit())UnsupportedOperationExceptionAbstractUnit.toSystemUnit()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 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 Map<? extends AbstractUnit<Q>,Integer> getBaseUnits()
getBaseUnits in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>getBaseUnits in class AbstractUnit<Q extends javax.measure.Quantity<Q>>Copyright © 2005–2021 Units of Measurement project. All rights reserved.