summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/unit/FunctionalUnit.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/sevenUnits/unit/FunctionalUnit.java')
-rw-r--r--src/main/java/sevenUnits/unit/FunctionalUnit.java22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/main/java/sevenUnits/unit/FunctionalUnit.java b/src/main/java/sevenUnits/unit/FunctionalUnit.java
index 6de446f..1d55b42 100644
--- a/src/main/java/sevenUnits/unit/FunctionalUnit.java
+++ b/src/main/java/sevenUnits/unit/FunctionalUnit.java
@@ -1,5 +1,5 @@
/**
- * Copyright (C) 2019 Adrien Hopkins
+ * Copyright (C) 2019, 2021, 2022, 2024, 2025 Adrien Hopkins
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
@@ -24,30 +24,33 @@ import sevenUnits.utils.ObjectProduct;
/**
* A unit that uses functional objects to convert to and from its base.
- *
+ *
* @author Adrien Hopkins
* @since 2019-05-22
+ * @since v0.3.0
*/
final class FunctionalUnit extends Unit {
/**
* A function that accepts a value expressed in the unit's base and returns
* that value expressed in this unit.
- *
+ *
* @since 2019-05-22
+ * @since v0.3.0
*/
private final DoubleUnaryOperator converterFrom;
/**
* A function that accepts a value expressed in the unit and returns that
* value expressed in the unit's base.
- *
+ *
* @since 2019-05-22
+ * @since v0.3.0
*/
private final DoubleUnaryOperator converterTo;
/**
* Creates the {@code FunctionalUnit}.
- *
+ *
* @param base unit's base
* @param converterFrom function that accepts a value expressed in the unit's
* base and returns that value expressed in this unit.
@@ -55,6 +58,7 @@ final class FunctionalUnit extends Unit {
* and returns that value expressed in the unit's base.
* @throws NullPointerException if any argument is null
* @since 2019-05-22
+ * @since v0.3.0
*/
public FunctionalUnit(final ObjectProduct<BaseUnit> base,
final DoubleUnaryOperator converterFrom,
@@ -68,14 +72,16 @@ final class FunctionalUnit extends Unit {
/**
* Creates the {@code FunctionalUnit}.
- *
+ *
* @param base unit's base
* @param converterFrom function that accepts a value expressed in the unit's
* base and returns that value expressed in this unit.
* @param converterTo function that accepts a value expressed in the unit
* and returns that value expressed in the unit's base.
+ * @param ns name and symbol of resulting unit
* @throws NullPointerException if any argument is null
* @since 2019-05-22
+ * @since v0.3.0
*/
public FunctionalUnit(final ObjectProduct<BaseUnit> base,
final DoubleUnaryOperator converterFrom,
@@ -89,7 +95,7 @@ final class FunctionalUnit extends Unit {
/**
* {@inheritDoc}
- *
+ *
* Uses {@code converterFrom} to convert.
*/
@Override
@@ -99,7 +105,7 @@ final class FunctionalUnit extends Unit {
/**
* {@inheritDoc}
- *
+ *
* Uses {@code converterTo} to convert.
*/
@Override