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.
name, ONE, SYMBOL_TO_UNIT
Constructor and Description |
---|
BaseUnit(String symbol)
Creates a base unit having the specified symbol and dimension.
|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object that) |
Map<? extends AbstractUnit<Q>,Integer> |
getBaseUnits() |
javax.measure.Dimension |
getDimension() |
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, transform
public 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 AbstractUnit<Q> toSystemUnit()
AbstractUnit
SI
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 UnsupportedOperationException
AbstractUnit
System Unit
unit.getSystemConverter
in class AbstractUnit<Q extends javax.measure.Quantity<Q>>
getConverterTo(this.toSystemUnit())
UnsupportedOperationException
#toSI
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 final boolean equals(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 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–2017 Units of Measurement project. All rights reserved.