Package de.timmfitschen.easyunits
Class DefaultSystemOfUnitsFactory
- java.lang.Object
-
- de.timmfitschen.easyunits.DefaultSystemOfUnitsFactory
-
- All Implemented Interfaces:
SystemOfUnitsFactory
public class DefaultSystemOfUnitsFactory extends Object implements SystemOfUnitsFactory
-
-
Constructor Summary
Constructors Constructor Description DefaultSystemOfUnitsFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BaseUnit b)
void
add(Prefix p)
void
add(DerivedUnit d)
protected void
addPrefixedUnit(Prefix prefix, Unit unit)
protected void
addUnitWithAllNames(Unit unit)
SystemOfUnits
create()
protected HashMap<String,Unit>
getAllunits()
Unit
getUnit(String unit)
-
-
-
Method Detail
-
create
public SystemOfUnits create()
- Specified by:
create
in interfaceSystemOfUnitsFactory
-
add
public void add(Prefix p) throws SystemOfUnitsException
- Specified by:
add
in interfaceSystemOfUnitsFactory
- Throws:
SystemOfUnitsException
-
addUnitWithAllNames
protected void addUnitWithAllNames(Unit unit) throws SystemOfUnitsException
- Throws:
SystemOfUnitsException
-
addPrefixedUnit
protected void addPrefixedUnit(Prefix prefix, Unit unit) throws SystemOfUnitsException
- Throws:
SystemOfUnitsException
-
add
public void add(DerivedUnit d) throws SystemOfUnitsException
- Specified by:
add
in interfaceSystemOfUnitsFactory
- Throws:
SystemOfUnitsException
-
add
public void add(BaseUnit b) throws SystemOfUnitsException
- Specified by:
add
in interfaceSystemOfUnitsFactory
- Throws:
SystemOfUnitsException
-
getUnit
public Unit getUnit(String unit)
- Specified by:
getUnit
in interfaceSystemOfUnitsFactory
-
-