diff options
author | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-02-01 09:14:45 -0500 |
---|---|---|
committer | Adrien Hopkins <adrien.p.hopkins@gmail.com> | 2019-02-01 09:14:45 -0500 |
commit | 70273e127b061c69ce4b3d9d6c3881c6b0c2b829 (patch) | |
tree | b45241f4c56a055148f4a15a47d2d6ff04fd382a /src/unitConverter/unit/UnitSystem.java | |
parent | 1def718782e0a7c32a42b5ceb24cd6c16ce3d6e0 (diff) | |
parent | a3dfff2c1a3a906fa2c3cb3f4cec1a150c5bf795 (diff) |
Release v0.1.0v0.1.0
Diffstat (limited to 'src/unitConverter/unit/UnitSystem.java')
-rwxr-xr-x | src/unitConverter/unit/UnitSystem.java | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/unitConverter/unit/UnitSystem.java b/src/unitConverter/unit/UnitSystem.java index 2e3a5d8..ce8c249 100755 --- a/src/unitConverter/unit/UnitSystem.java +++ b/src/unitConverter/unit/UnitSystem.java @@ -16,16 +16,38 @@ */ package unitConverter.unit; +import java.util.Objects; + +import unitConverter.dimension.UnitDimension; + /** * A system of units. Each unit should be aware of its system. * * @author Adrien Hopkins * @since 2018-12-23 + * @since v0.1.0 */ public interface UnitSystem { /** - * @return name of system + * Gets a base unit for this system and the provided dimension. + * + * @param dimension + * dimension used by base unit + * @return base unit + * @throws NullPointerException + * if dimension is null * @since 2019-01-25 + * @since v0.1.0 + */ + default BaseUnit getBaseUnit(final UnitDimension dimension) { + Objects.requireNonNull(dimension, "dimension must not be null."); + return new BaseUnit(dimension, this); + } + + /** + * @return name of system + * @since 2018-12-23 + * @since v0.1.0 */ String getName(); } |