From abe715a30844537693ae186308adcab62c66f121 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Wed, 16 Oct 2019 15:35:30 -0400 Subject: Made Unit an abstract class. The abstract unit conversion methods are now protected. --- src/org/unitConverter/newUnits/BaseUnit.java | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'src/org/unitConverter/newUnits/BaseUnit.java') diff --git a/src/org/unitConverter/newUnits/BaseUnit.java b/src/org/unitConverter/newUnits/BaseUnit.java index b7577ff..2c4d748 100644 --- a/src/org/unitConverter/newUnits/BaseUnit.java +++ b/src/org/unitConverter/newUnits/BaseUnit.java @@ -19,7 +19,6 @@ package org.unitConverter.newUnits; import java.util.Objects; import org.unitConverter.dimension.BaseDimension; -import org.unitConverter.math.ObjectProduct; /** * A unit that other units are defined by. @@ -27,7 +26,7 @@ import org.unitConverter.math.ObjectProduct; * @author Adrien Hopkins * @since 2019-10-16 */ -public final class BaseUnit implements Unit { +public final class BaseUnit extends Unit { private final BaseDimension dimension; private final String name; private final String symbol; @@ -46,6 +45,7 @@ public final class BaseUnit implements Unit { * @since 2019-10-16 */ private BaseUnit(final BaseDimension dimension, final String name, final String symbol) { + super(); this.dimension = Objects.requireNonNull(dimension, "dimension must not be null."); this.name = Objects.requireNonNull(name, "name must not be null."); this.symbol = Objects.requireNonNull(symbol, "symbol must not be null."); @@ -72,11 +72,6 @@ public final class BaseUnit implements Unit { return value; } - @Override - public ObjectProduct getBase() { - return ObjectProduct.oneOf(this); - } - /** * @return dimension * @since 2019-10-16 @@ -85,11 +80,6 @@ public final class BaseUnit implements Unit { return this.dimension; } - @Override - public ObjectProduct getDimension() { - return ObjectProduct.oneOf(this.getBaseDimension()); - } - /** * @return name * @since 2019-10-16 -- cgit v1.2.3