summaryrefslogtreecommitdiff
path: root/src/unitConverter/unit/UnitSystem.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/unitConverter/unit/UnitSystem.java')
-rwxr-xr-xsrc/unitConverter/unit/UnitSystem.java24
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();
}