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.
| Modifier and Type | Field and Description |
|---|---|
private javax.measure.Dimension |
dimension
Holds the base unit dimension.
|
private static long |
serialVersionUID |
private java.lang.String |
symbol
Holds the symbol.
|
name, ONE, SYMBOL_TO_UNIT| Constructor and Description |
|---|
BaseUnit(java.lang.String symbol)
Creates a base unit having the specified symbol and dimension.
|
BaseUnit(java.lang.String symbol,
javax.measure.Dimension dimension)
Creates a base unit having the specified symbol and dimension.
|
BaseUnit(java.lang.String symbol,
java.lang.String name)
Creates a base unit having the specified symbol and name.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object that) |
java.util.Map<? extends AbstractUnit<Q>,java.lang.Integer> |
getBaseUnits() |
javax.measure.Dimension |
getDimension() |
java.lang.String |
getSymbol() |
javax.measure.UnitConverter |
getSystemConverter()
Returns the converter from this unit to its unscaled
System Unit unit. |
int |
hashCode() |
AbstractUnit<Q> |
toSystemUnit()
Returns the unscaled
SI unit from which this unit is derived. |
alternate, annotate, asType, compareTo, divide, divide, divide, getActualType, getConverterTo, getConverterToAny, getName, getSystemUnit, inverse, isCompatible, isSystemUnit, multiply, multiply, multiply, parse, pow, root, setName, setSymbol, shift, toString, transformprivate static final long serialVersionUID
private final java.lang.String symbol
private final javax.measure.Dimension dimension
public BaseUnit(java.lang.String symbol,
javax.measure.Dimension dimension)
symbol - the symbol of this base unit.public BaseUnit(java.lang.String symbol)
symbol - the symbol of this base unit.public BaseUnit(java.lang.String symbol,
java.lang.String name)
symbol - the symbol of this base unit.name - the name of this base unit.java.lang.IllegalArgumentException - if the specified symbol is associated to a different unit.public java.lang.String getSymbol()
public AbstractUnit<Q> toSystemUnit()
AbstractUnitSI unit from which this unit is derived.
They SI unit can be be used to identify a quantity given the unit. For example:[code] static boolean isAngularVelocity(AbstractUnit> unit) {
return unit.toSI().equals(RADIAN.divide(SECOND)); } assert(REVOLUTION.divide(MINUTE).isAngularVelocity()); // Returns true. [/code]toSystemUnit in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public javax.measure.UnitConverter getSystemConverter()
throws java.lang.UnsupportedOperationException
AbstractUnitSystem Unit unit.getSystemConverter in class AbstractUnit<Q extends javax.measure.Quantity<Q>>getConverterTo(this.toSystemUnit())java.lang.UnsupportedOperationException#toSIpublic 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 final boolean equals(java.lang.Object that)
equals in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public final int hashCode()
hashCode in class AbstractUnit<Q extends javax.measure.Quantity<Q>>public java.util.Map<? extends AbstractUnit<Q>,java.lang.Integer> getBaseUnits()
getBaseUnits in interface javax.measure.Unit<Q extends javax.measure.Quantity<Q>>getBaseUnits in class AbstractUnit<Q extends javax.measure.Quantity<Q>>