public abstract class AbstractSystemOfUnits extends Object implements javax.measure.spi.SystemOfUnits, tech.uom.lib.common.function.Nameable
An abstract base class for unit systems.
| Modifier and Type | Class and Description |
|---|---|
protected static class |
AbstractSystemOfUnits.Helper |
| Modifier and Type | Field and Description |
|---|---|
protected static double |
E
The natural logarithm.
|
protected static Logger |
logger |
protected Map<Class<? extends javax.measure.Quantity>,javax.measure.Unit> |
quantityToUnit
Holds the mapping quantity to unit.
|
protected Set<javax.measure.Unit<?>> |
units
Holds the units.
|
| Constructor and Description |
|---|
AbstractSystemOfUnits() |
| Modifier and Type | Method and Description |
|---|---|
abstract String |
getName() |
<Q extends javax.measure.Quantity<Q>> |
getUnit(Class<Q> quantityType) |
javax.measure.Unit<?> |
getUnit(String string) |
javax.measure.Unit<?> |
getUnit(String string,
UnitStyle style)
|
javax.measure.Unit<?> |
getUnit(String string,
UnitStyle style,
boolean ignoreCase)
|
Set<javax.measure.Unit<?>> |
getUnits() |
Set<? extends javax.measure.Unit<?>> |
getUnits(javax.measure.Dimension dimension) |
protected static final double E
protected final Map<Class<? extends javax.measure.Quantity>,javax.measure.Unit> quantityToUnit
public AbstractSystemOfUnits()
public abstract String getName()
getName in interface javax.measure.spi.SystemOfUnitsgetName in interface tech.uom.lib.common.function.Nameablepublic Set<javax.measure.Unit<?>> getUnits()
getUnits in interface javax.measure.spi.SystemOfUnitspublic Set<? extends javax.measure.Unit<?>> getUnits(javax.measure.Dimension dimension)
getUnits in interface javax.measure.spi.SystemOfUnitspublic <Q extends javax.measure.Quantity<Q>> javax.measure.Unit<Q> getUnit(Class<Q> quantityType)
getUnit in interface javax.measure.spi.SystemOfUnitspublic javax.measure.Unit<?> getUnit(String string)
getUnit in interface javax.measure.spi.SystemOfUnitspublic javax.measure.Unit<?> getUnit(String string, UnitStyle style, boolean ignoreCase)
Returns a unit with the given string representation in a
particular style or null if none is found in
this unit system and requested style.
NOTE: Use ignoreCase carefully, as it will find the
FIRST unit for a particular string, e.g. the symbol of SECOND
and SIEMENS would be the same without case, but the UPPERCASE letter
sorted first.
string - the string representation of a unit, not null.style - the style of unit representation.ignoreCase - ignore the case or not?public javax.measure.Unit<?> getUnit(String string, UnitStyle style)
null if none is found in
this unit system and requested style.string - the string representation of a unit, not null.style - the style of unit representation.Copyright © 2005–2021 Units of Measurement project. All rights reserved.