Package tech.units.indriya
Class AbstractSystemOfUnits
- java.lang.Object
-
- tech.units.indriya.AbstractSystemOfUnits
-
- All Implemented Interfaces:
SystemOfUnits,tech.uom.lib.common.function.Nameable
- Direct Known Subclasses:
Units
public abstract class AbstractSystemOfUnits extends Object implements SystemOfUnits, tech.uom.lib.common.function.Nameable
An abstract base class for unit systems.
- Since:
- 1.0
- Version:
- 2.3, November 23, 2024
- Author:
- Werner Keil
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractSystemOfUnits.HelperStatic helper class.
-
Constructor Summary
Constructors Constructor Description AbstractSystemOfUnits()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringgetName()<Q extends Quantity<Q>>
Unit<Q>getUnit(Class<Q> quantityType)Unit<?>getUnit(String string)Unit<?>getUnit(String string, UnitStyle style)Unit<?>getUnit(String string, UnitStyle style, boolean ignoreCase)Set<Unit<?>>getUnits()Set<? extends Unit<?>>getUnits(Dimension dimension)
-
-
-
Constructor Detail
-
AbstractSystemOfUnits
public AbstractSystemOfUnits()
-
-
Method Detail
-
getName
public abstract String getName()
- Specified by:
getNamein interfacetech.uom.lib.common.function.Nameable- Specified by:
getNamein interfaceSystemOfUnits
-
getUnits
public Set<Unit<?>> getUnits()
- Specified by:
getUnitsin interfaceSystemOfUnits
-
getUnits
public Set<? extends Unit<?>> getUnits(Dimension dimension)
- Specified by:
getUnitsin interfaceSystemOfUnits
-
getUnit
public <Q extends Quantity<Q>> Unit<Q> getUnit(Class<Q> quantityType)
- Specified by:
getUnitin interfaceSystemOfUnits
-
getUnit
public Unit<?> getUnit(String string)
- Specified by:
getUnitin interfaceSystemOfUnits
-
getUnit
public Unit<?> getUnit(String string, UnitStyle style, boolean ignoreCase)
Returns a unit with the given string representation in a particular style ornullif none is found in this unit system and requested style.NOTE: Use
ignoreCasecarefully, as it will find the FIRST unit for a particular string, e.g. the symbol ofSECONDandSIEMENSwould be the same without case, but the UPPERCASE letter sorted first.- Parameters:
string- the string representation of a unit, notnull.style- the style of unit representation.ignoreCase- ignore the case or not?- Returns:
- the unit with the given string representation.
- Since:
- 2.0
-
getUnit
public Unit<?> getUnit(String string, UnitStyle style)
Returns a unit with the given string representation in a particular style ornullif none is found in this unit system and requested style.- Parameters:
string- the string representation of a unit, notnull.style- the style of unit representation.- Returns:
- the unit with the given string representation.
- Since:
- 2.0
-
-