summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-06-04 19:45:37 -0500
committerAdrien Hopkins <adrien.p.hopkins@gmail.com>2025-06-04 19:45:37 -0500
commit79e1653caf5c30667877a158433cbcd766a135af (patch)
tree891527e7365bf78eab3722704c1f74e57fbbca7d
parentd80b80857e739eb32afd7625789944abd3afe376 (diff)
Add version numbers to all @since tags
Specifically, for every @since tag with a date, I added another that contains the correspending version. I did not add date @since tags to comments that do not have them, as that would be too tedious for what it's worth. These dates could still be found by using git bisect though.
-rw-r--r--src/main/java/sevenUnits/ProgramInfo.java2
-rw-r--r--src/main/java/sevenUnits/unit/BaseDimension.java3
-rw-r--r--src/main/java/sevenUnits/unit/BaseUnit.java6
-rw-r--r--src/main/java/sevenUnits/unit/BritishImperial.java5
-rw-r--r--src/main/java/sevenUnits/unit/FunctionalUnit.java5
-rw-r--r--src/main/java/sevenUnits/unit/LinearUnit.java14
-rw-r--r--src/main/java/sevenUnits/unit/LinearUnitValue.java23
-rw-r--r--src/main/java/sevenUnits/unit/LoadingException.java1
-rw-r--r--src/main/java/sevenUnits/unit/Metric.java2
-rw-r--r--src/main/java/sevenUnits/unit/USCustomary.java5
-rw-r--r--src/main/java/sevenUnits/unit/Unit.java14
-rw-r--r--src/main/java/sevenUnits/unit/UnitDatabase.java24
-rw-r--r--src/main/java/sevenUnits/unit/UnitPrefix.java11
-rw-r--r--src/main/java/sevenUnits/unit/UnitType.java2
-rw-r--r--src/main/java/sevenUnits/unit/UnitValue.java6
-rw-r--r--src/main/java/sevenUnits/utils/ConditionalExistenceCollections.java14
-rw-r--r--src/main/java/sevenUnits/utils/DecimalComparison.java1
-rw-r--r--src/main/java/sevenUnits/utils/ExpressionParser.java2
-rw-r--r--src/main/java/sevenUnits/utils/NameSymbol.java14
-rw-r--r--src/main/java/sevenUnits/utils/Nameable.java7
-rw-r--r--src/main/java/sevenUnits/utils/ObjectProduct.java15
-rw-r--r--src/main/java/sevenUnits/utils/SemanticVersionNumber.java48
-rw-r--r--src/main/java/sevenUnits/utils/UncertainDouble.java24
-rw-r--r--src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java1
-rw-r--r--src/main/java/sevenUnitsGUI/DelegateListModel.java1
-rw-r--r--src/main/java/sevenUnitsGUI/ExpressionConversionView.java8
-rw-r--r--src/main/java/sevenUnitsGUI/Main.java4
-rw-r--r--src/main/java/sevenUnitsGUI/PrefixSearchRule.java12
-rw-r--r--src/main/java/sevenUnitsGUI/Presenter.java45
-rw-r--r--src/main/java/sevenUnitsGUI/SearchBoxList.java5
-rw-r--r--src/main/java/sevenUnitsGUI/StandardDisplayRules.java20
-rw-r--r--src/main/java/sevenUnitsGUI/TabbedView.java20
-rw-r--r--src/main/java/sevenUnitsGUI/UnitConversionRecord.java17
-rw-r--r--src/main/java/sevenUnitsGUI/UnitConversionView.java24
-rw-r--r--src/main/java/sevenUnitsGUI/View.java20
-rw-r--r--src/main/java/sevenUnitsGUI/ViewBot.java26
-rw-r--r--src/main/java/sevenUnitsGUI/package-info.java1
-rw-r--r--src/test/java/sevenUnits/unit/UnitDatabaseTest.java15
-rw-r--r--src/test/java/sevenUnits/unit/UnitValueTest.java10
-rw-r--r--src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java3
-rw-r--r--src/test/java/sevenUnits/utils/ExpressionParserTest.java1
-rw-r--r--src/test/java/sevenUnits/utils/NameSymbolTest.java5
-rw-r--r--src/test/java/sevenUnits/utils/SemanticVersionTest.java10
-rw-r--r--src/test/java/sevenUnits/utils/UncertainDoubleTest.java2
-rw-r--r--src/test/java/sevenUnitsGUI/I18nTest.java7
-rw-r--r--src/test/java/sevenUnitsGUI/PrefixRepetitionTest.java10
-rw-r--r--src/test/java/sevenUnitsGUI/PrefixSearchTest.java16
-rw-r--r--src/test/java/sevenUnitsGUI/PresenterTest.java26
-rw-r--r--src/test/java/sevenUnitsGUI/RoundingTest.java23
-rw-r--r--src/test/java/sevenUnitsGUI/TabbedViewTest.java8
50 files changed, 460 insertions, 128 deletions
diff --git a/src/main/java/sevenUnits/ProgramInfo.java b/src/main/java/sevenUnits/ProgramInfo.java
index dda5d2c..9b9832e 100644
--- a/src/main/java/sevenUnits/ProgramInfo.java
+++ b/src/main/java/sevenUnits/ProgramInfo.java
@@ -21,8 +21,8 @@ import sevenUnits.utils.SemanticVersionNumber;
/**
* Information about 7Units
*
- * @since 0.3.1
* @since 2021-06-28
+ * @since v0.3.1
*/
public final class ProgramInfo {
diff --git a/src/main/java/sevenUnits/unit/BaseDimension.java b/src/main/java/sevenUnits/unit/BaseDimension.java
index cfa6af9..fe7b772 100644
--- a/src/main/java/sevenUnits/unit/BaseDimension.java
+++ b/src/main/java/sevenUnits/unit/BaseDimension.java
@@ -26,6 +26,7 @@ import sevenUnits.utils.Nameable;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
public final class BaseDimension implements Nameable {
/**
@@ -35,6 +36,7 @@ public final class BaseDimension implements Nameable {
* @param symbol symbol used for dimension
* @return dimension
* @since 2019-10-16
+ * @since v0.3.0
*/
public static BaseDimension valueOf(final String name, final String symbol) {
return new BaseDimension(name, symbol);
@@ -57,6 +59,7 @@ public final class BaseDimension implements Nameable {
* @param symbol symbol of unit
* @throws NullPointerException if any argument is null
* @since 2019-10-16
+ * @since v0.3.0
*/
private BaseDimension(final String name, final String symbol) {
this.name = Objects.requireNonNull(name, "name must not be null.");
diff --git a/src/main/java/sevenUnits/unit/BaseUnit.java b/src/main/java/sevenUnits/unit/BaseUnit.java
index 0d375f8..2898de5 100644
--- a/src/main/java/sevenUnits/unit/BaseUnit.java
+++ b/src/main/java/sevenUnits/unit/BaseUnit.java
@@ -31,6 +31,7 @@ import sevenUnits.utils.NameSymbol;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
public final class BaseUnit extends Unit {
/**
@@ -41,6 +42,7 @@ public final class BaseUnit extends Unit {
* @param symbol symbol of unit
* @return base unit
* @since 2019-10-16
+ * @since v0.3.0
*/
public static BaseUnit valueOf(final BaseDimension dimension,
final String name, final String symbol) {
@@ -56,6 +58,7 @@ public final class BaseUnit extends Unit {
* @param otherNames other possible names of unit
* @return base unit
* @since 2019-10-21
+ * @since v0.3.0
*/
public static BaseUnit valueOf(final BaseDimension dimension,
final String name, final String symbol, final Set<String> otherNames) {
@@ -75,6 +78,7 @@ public final class BaseUnit extends Unit {
* @param symbol symbol of unit
* @throws NullPointerException if any argument is null
* @since 2019-10-16
+ * @since v0.3.0
*/
private BaseUnit(final BaseDimension dimension, final String primaryName,
final String symbol, final Set<String> otherNames) {
@@ -90,6 +94,7 @@ public final class BaseUnit extends Unit {
*
* @return this unit as a {@code LinearUnit}
* @since 2019-10-16
+ * @since v0.3.0
*/
public LinearUnit asLinearUnit() {
return LinearUnit.valueOf(this.getBase(), 1);
@@ -108,6 +113,7 @@ public final class BaseUnit extends Unit {
/**
* @return dimension
* @since 2019-10-16
+ * @since v0.3.0
*/
public final BaseDimension getBaseDimension() {
return this.dimension;
diff --git a/src/main/java/sevenUnits/unit/BritishImperial.java b/src/main/java/sevenUnits/unit/BritishImperial.java
index e327055..a6fd43f 100644
--- a/src/main/java/sevenUnits/unit/BritishImperial.java
+++ b/src/main/java/sevenUnits/unit/BritishImperial.java
@@ -23,6 +23,7 @@ import sevenUnits.utils.NameSymbol;
*
* @author Adrien Hopkins
* @since 2019-10-21
+ * @since v0.3.0
*/
// this class is just constants, most of which are obvious from the variable name
// so no need to check for missing values
@@ -33,6 +34,7 @@ public final class BritishImperial {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Area {
public static final LinearUnit SQUARE_FOOT = Length.FOOT.toExponent(2);
@@ -48,6 +50,7 @@ public final class BritishImperial {
*
* @author Adrien Hopkins
* @since 2019-10-28
+ * @since v0.3.0
*/
public static final class Length {
/**
@@ -81,6 +84,7 @@ public final class BritishImperial {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Mass {
public static final LinearUnit POUND = Metric.GRAM.times(453.59237);
@@ -99,6 +103,7 @@ public final class BritishImperial {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Volume {
public static final LinearUnit FLUID_OUNCE = Metric.LITRE
diff --git a/src/main/java/sevenUnits/unit/FunctionalUnit.java b/src/main/java/sevenUnits/unit/FunctionalUnit.java
index fb24629..41db164 100644
--- a/src/main/java/sevenUnits/unit/FunctionalUnit.java
+++ b/src/main/java/sevenUnits/unit/FunctionalUnit.java
@@ -27,6 +27,7 @@ import sevenUnits.utils.ObjectProduct;
*
* @author Adrien Hopkins
* @since 2019-05-22
+ * @since v0.3.0
*/
final class FunctionalUnit extends Unit {
/**
@@ -34,6 +35,7 @@ final class FunctionalUnit extends Unit {
* that value expressed in this unit.
*
* @since 2019-05-22
+ * @since v0.3.0
*/
private final DoubleUnaryOperator converterFrom;
@@ -42,6 +44,7 @@ final class FunctionalUnit extends Unit {
* value expressed in the unit's base.
*
* @since 2019-05-22
+ * @since v0.3.0
*/
private final DoubleUnaryOperator converterTo;
@@ -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,
@@ -77,6 +81,7 @@ final class FunctionalUnit extends Unit {
* @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,
diff --git a/src/main/java/sevenUnits/unit/LinearUnit.java b/src/main/java/sevenUnits/unit/LinearUnit.java
index 6c1aba3..7191196 100644
--- a/src/main/java/sevenUnits/unit/LinearUnit.java
+++ b/src/main/java/sevenUnits/unit/LinearUnit.java
@@ -29,6 +29,7 @@ import sevenUnits.utils.UncertainDouble;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
public final class LinearUnit extends Unit {
/**
@@ -39,6 +40,7 @@ public final class LinearUnit extends Unit {
* @param value value to convert
* @return value expressed as a {@code LinearUnit}
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if unit is null
*/
public static LinearUnit fromUnitValue(final Unit unit, final double value) {
@@ -56,6 +58,7 @@ public final class LinearUnit extends Unit {
* @param ns name(s) and symbol of unit
* @return value expressed as a {@code LinearUnit}
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if unit or ns is null
*/
public static LinearUnit fromUnitValue(final Unit unit, final double value,
@@ -70,6 +73,7 @@ public final class LinearUnit extends Unit {
* @return the base unit associated with {@code unit}, as a
* {@code LinearUnit}.
* @since 2020-10-02
+ * @since v0.3.0
*/
public static LinearUnit getBase(final Unit unit) {
return new LinearUnit(unit.getBase(), 1, NameSymbol.EMPTY);
@@ -84,6 +88,7 @@ public final class LinearUnit extends Unit {
* @param conversionFactor number to multiply base by
* @return product of base and conversion factor
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if unitBase is null
*/
public static LinearUnit valueOf(final ObjectProduct<BaseUnit> unitBase,
@@ -101,6 +106,7 @@ public final class LinearUnit extends Unit {
* @param ns name(s) and symbol of unit
* @return product of base and conversion factor
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if unitBase is null
*/
public static LinearUnit valueOf(final ObjectProduct<BaseUnit> unitBase,
@@ -116,6 +122,7 @@ public final class LinearUnit extends Unit {
* </pre>
*
* @since 2019-10-16
+ * @since v0.3.0
*/
private final double conversionFactor;
@@ -125,6 +132,7 @@ public final class LinearUnit extends Unit {
* @param unitBase base of linear unit
* @param conversionFactor conversion factor between base and unit
* @since 2019-10-16
+ * @since v0.3.0
*/
private LinearUnit(final ObjectProduct<BaseUnit> unitBase,
final double conversionFactor, final NameSymbol ns) {
@@ -150,6 +158,7 @@ public final class LinearUnit extends Unit {
* @param value value to convert
* @return converted value
* @since 2019-09-07
+ * @since v0.3.0
* @throws IllegalArgumentException if {@code other} is incompatible for
* conversion with this unit (as tested by
* {@link Unit#canConvertTo}).
@@ -181,6 +190,7 @@ public final class LinearUnit extends Unit {
* Converts an {@code UncertainDouble} to the base unit.
*
* @since 2020-09-07
+ * @since v0.3.0
*/
UncertainDouble convertToBase(final UncertainDouble value) {
return value.timesExact(this.getConversionFactor());
@@ -249,6 +259,7 @@ public final class LinearUnit extends Unit {
/**
* @return conversion factor
* @since 2019-10-16
+ * @since v0.3.0
*/
public double getConversionFactor() {
return this.conversionFactor;
@@ -270,6 +281,7 @@ public final class LinearUnit extends Unit {
* is a {@code BaseUnit b} where
* {@code b.asLinearUnit().equals(this)} returns {@code true}.)
* @since 2019-10-16
+ * @since v0.3.0
*/
public boolean isBase() {
return this.isCoherent() && this.getBase().isSingleObject();
@@ -278,6 +290,7 @@ public final class LinearUnit extends Unit {
/**
* @return whether this unit is coherent (i.e. has conversion factor 1)
* @since 2019-10-16
+ * @since v0.3.0
*/
public boolean isCoherent() {
return this.getConversionFactor() == 1;
@@ -403,6 +416,7 @@ public final class LinearUnit extends Unit {
* @param exponent exponent to raise unit to
* @return result of rounded exponentation
* @since 2024-08-22
+ * @since v1.0.0
* @see ObjectProduct#toExponentRounded
*/
public LinearUnit toExponentRounded(final double exponent) {
diff --git a/src/main/java/sevenUnits/unit/LinearUnitValue.java b/src/main/java/sevenUnits/unit/LinearUnitValue.java
index 8d30907..86520d7 100644
--- a/src/main/java/sevenUnits/unit/LinearUnitValue.java
+++ b/src/main/java/sevenUnits/unit/LinearUnitValue.java
@@ -34,6 +34,7 @@ import sevenUnits.utils.UncertainDouble;
*
* @author Adrien Hopkins
* @since 2020-07-26
+ * @since v0.3.0
*/
public final class LinearUnitValue {
/** The value 1 as a LinearUnitValue. */
@@ -46,6 +47,7 @@ public final class LinearUnitValue {
* @param value value to express
* @return exact {@code LinearUnitValue} instance
* @since 2020-07-26
+ * @since v0.3.0
*/
public static final LinearUnitValue getExact(final LinearUnit unit,
final double value) {
@@ -61,6 +63,7 @@ public final class LinearUnitValue {
* @param value value to express
* @return uncertain {@code LinearUnitValue} instance
* @since 2020-07-26
+ * @since v0.3.0
*/
public static final LinearUnitValue of(final LinearUnit unit,
final UncertainDouble value) {
@@ -77,6 +80,7 @@ public final class LinearUnitValue {
* @param unit unit to express as
* @param value value to express
* @since 2020-07-26
+ * @since v0.3.0
*/
private LinearUnitValue(final LinearUnit unit, final UncertainDouble value) {
this.unit = unit;
@@ -87,6 +91,7 @@ public final class LinearUnitValue {
* @return this value as a {@code UnitValue}. All uncertainty information is
* removed from the returned value.
* @since 2020-08-04
+ * @since v0.3.0
*/
public final UnitValue asUnitValue() {
return UnitValue.of(this.unit, this.value.value());
@@ -96,6 +101,7 @@ public final class LinearUnitValue {
* @param other a {@code LinearUnit}
* @return true iff this value can be represented with {@code other}.
* @since 2020-07-26
+ * @since v0.3.0
*/
public final boolean canConvertTo(final LinearUnit other) {
return this.unit.canConvertTo(other);
@@ -108,6 +114,7 @@ public final class LinearUnitValue {
* @param other new unit to express value in
* @return value expressed in {@code other}
* @since 2020-07-26
+ * @since v0.3.0
*/
public final LinearUnitValue convertTo(final LinearUnit other) {
return LinearUnitValue.of(other, this.unit.convertTo(other, this.value));
@@ -122,6 +129,7 @@ public final class LinearUnitValue {
* @throws IllegalArgumentException if no units are provided or units
* provided have incompatible bases
* @since 2024-08-15
+ * @since v1.0.0
*/
public final List<LinearUnitValue> convertToMultiple(
final List<LinearUnit> others) {
@@ -155,6 +163,7 @@ public final class LinearUnitValue {
* @param divisor value to divide by
* @return multiplied value
* @since 2020-07-28
+ * @since v0.3.0
*/
public LinearUnitValue dividedBy(final double divisor) {
return LinearUnitValue.of(this.unit, this.value.dividedByExact(divisor));
@@ -166,6 +175,7 @@ public final class LinearUnitValue {
* @param divisor value to multiply by
* @return quotient
* @since 2020-07-28
+ * @since v0.3.0
*/
public LinearUnitValue dividedBy(final LinearUnitValue divisor) {
return LinearUnitValue.of(this.unit.dividedBy(divisor.unit),
@@ -178,6 +188,7 @@ public final class LinearUnitValue {
* km) returns true.
*
* @since 2020-07-26
+ * @since v0.3.0
* @see #equals(Object, boolean)
*/
@Override
@@ -202,6 +213,7 @@ public final class LinearUnitValue {
* @return true iff this and obj are equal
*
* @since 2020-07-28
+ * @since v0.3.0
*/
public boolean equals(final Object obj, final boolean avoidFPErrors) {
if (!avoidFPErrors)
@@ -219,6 +231,7 @@ public final class LinearUnitValue {
* @return true iff this and other are within each other's uncertainty range
*
* @since 2020-07-26
+ * @since v0.3.0
*/
public boolean equivalent(final LinearUnitValue other) {
if (other == null
@@ -234,6 +247,7 @@ public final class LinearUnitValue {
/**
* @return the unit
* @since 2020-09-29
+ * @since v0.3.0
*/
public final LinearUnit getUnit() {
return this.unit;
@@ -242,6 +256,7 @@ public final class LinearUnitValue {
/**
* @return the value
* @since 2020-09-29
+ * @since v0.3.0
*/
public final UncertainDouble getValue() {
return this.value;
@@ -250,6 +265,7 @@ public final class LinearUnitValue {
/**
* @return the exact value
* @since 2020-09-07
+ * @since v0.3.0
*/
public final double getValueExact() {
return this.value.value();
@@ -270,6 +286,7 @@ public final class LinearUnitValue {
* @throws IllegalArgumentException if {@code subtrahend} has a unit that is
* not compatible for addition
* @since 2020-07-26
+ * @since v0.3.0
*/
public LinearUnitValue minus(final LinearUnitValue subtrahend) {
Objects.requireNonNull(subtrahend, "subtrahend may not be null");
@@ -292,6 +309,7 @@ public final class LinearUnitValue {
* @throws IllegalArgumentException if {@code addend} has a unit that is not
* compatible for addition
* @since 2020-07-26
+ * @since v0.3.0
*/
public LinearUnitValue plus(final LinearUnitValue addend) {
Objects.requireNonNull(addend, "addend may not be null");
@@ -312,6 +330,7 @@ public final class LinearUnitValue {
* @param multiplier value to multiply by
* @return multiplied value
* @since 2020-07-28
+ * @since v0.3.0
*/
public LinearUnitValue times(final double multiplier) {
return LinearUnitValue.of(this.unit, this.value.timesExact(multiplier));
@@ -323,6 +342,7 @@ public final class LinearUnitValue {
* @param multiplier value to multiply by
* @return product
* @since 2020-07-28
+ * @since v0.3.0
*/
public LinearUnitValue times(final LinearUnitValue multiplier) {
return LinearUnitValue.of(this.unit.times(multiplier.unit),
@@ -335,6 +355,7 @@ public final class LinearUnitValue {
* @param exponent exponent to raise to
* @return result of exponentiation
* @since 2020-07-28
+ * @since v0.3.0
*/
public LinearUnitValue toExponent(final int exponent) {
return LinearUnitValue.of(this.unit.toExponent(exponent),
@@ -348,6 +369,7 @@ public final class LinearUnitValue {
* @return result of exponentation
*
* @since 2024-08-22
+ * @since v1.0.0
* @see ObjectProduct#toExponentRounded
*/
public LinearUnitValue toExponentRounded(final double exponent) {
@@ -375,6 +397,7 @@ public final class LinearUnitValue {
* @return string representing this value
*
* @since 2020-07-26
+ * @since v0.3.0
*/
public String toString(final boolean showUncertainty,
RoundingMode roundingMode) {
diff --git a/src/main/java/sevenUnits/unit/LoadingException.java b/src/main/java/sevenUnits/unit/LoadingException.java
index b806147..7b3d708 100644
--- a/src/main/java/sevenUnits/unit/LoadingException.java
+++ b/src/main/java/sevenUnits/unit/LoadingException.java
@@ -25,6 +25,7 @@ import java.util.Optional;
*
* @author Adrien Hopkins
* @since 2024-08-22
+ * @since v1.0.0
*/
public final class LoadingException extends RuntimeException {
/** The type of file that was being loaded. */
diff --git a/src/main/java/sevenUnits/unit/Metric.java b/src/main/java/sevenUnits/unit/Metric.java
index 166cbcf..34fd0b8 100644
--- a/src/main/java/sevenUnits/unit/Metric.java
+++ b/src/main/java/sevenUnits/unit/Metric.java
@@ -36,6 +36,7 @@ import sevenUnits.utils.ObjectProduct;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
// this class is just constants, most of which are obvious from the variable name
// so no need to check for missing values
@@ -109,6 +110,7 @@ public final class Metric {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Constants {
public static final LinearUnit EARTH_GRAVITY = METRE.dividedBy(SECOND)
diff --git a/src/main/java/sevenUnits/unit/USCustomary.java b/src/main/java/sevenUnits/unit/USCustomary.java
index 1923d9e..be8c5e2 100644
--- a/src/main/java/sevenUnits/unit/USCustomary.java
+++ b/src/main/java/sevenUnits/unit/USCustomary.java
@@ -21,6 +21,7 @@ package sevenUnits.unit;
*
* @author Adrien Hopkins
* @since 2019-10-21
+ * @since v0.3.0
*/
// this class is just constants, most of which are obvious from the variable name
// so no need to check for missing values
@@ -31,6 +32,7 @@ public final class USCustomary {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Area {
public static final LinearUnit SQUARE_SURVEY_FOOT = Length.SURVEY_FOOT
@@ -49,6 +51,7 @@ public final class USCustomary {
*
* @author Adrien Hopkins
* @since 2019-10-28
+ * @since v0.3.0
*/
public static final class Length {
public static final LinearUnit FOOT = BritishImperial.Length.FOOT;
@@ -79,6 +82,7 @@ public final class USCustomary {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Mass {
public static final LinearUnit GRAIN = BritishImperial.Mass.GRAIN;
@@ -99,6 +103,7 @@ public final class USCustomary {
*
* @author Adrien Hopkins
* @since 2019-11-08
+ * @since v0.3.0
*/
public static final class Volume {
public static final LinearUnit CUBIC_INCH = Length.INCH.toExponent(3);
diff --git a/src/main/java/sevenUnits/unit/Unit.java b/src/main/java/sevenUnits/unit/Unit.java
index 5d67ed0..d651fe2 100644
--- a/src/main/java/sevenUnits/unit/Unit.java
+++ b/src/main/java/sevenUnits/unit/Unit.java
@@ -31,6 +31,7 @@ import sevenUnits.utils.ObjectProduct;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
public abstract class Unit implements Nameable {
/**
@@ -51,6 +52,7 @@ public abstract class Unit implements Nameable {
* and returns that value expressed in the unit's base.
* @return a unit that uses the provided functions to convert.
* @since 2019-05-22
+ * @since v0.3.0
* @throws NullPointerException if any argument is null
*/
public static final Unit fromConversionFunctions(
@@ -79,6 +81,7 @@ public abstract class Unit implements Nameable {
* @param ns names and symbol of unit
* @return a unit that uses the provided functions to convert.
* @since 2019-05-22
+ * @since v0.3.0
* @throws NullPointerException if any argument is null
*/
public static final Unit fromConversionFunctions(
@@ -92,6 +95,7 @@ public abstract class Unit implements Nameable {
* The combination of units that this unit is based on.
*
* @since 2019-10-16
+ * @since v0.3.0
*/
private final ObjectProduct<BaseUnit> unitBase;
@@ -99,6 +103,7 @@ public abstract class Unit implements Nameable {
* This unit's name(s) and symbol
*
* @since 2020-09-07
+ * @since v0.3.0
*/
private final NameSymbol nameSymbol;
@@ -106,6 +111,7 @@ public abstract class Unit implements Nameable {
* Cache storing the result of getDimension()
*
* @since 2019-10-16
+ * @since v0.3.0
*/
private transient ObjectProduct<BaseDimension> dimension = null;
@@ -113,6 +119,7 @@ public abstract class Unit implements Nameable {
* A constructor that constructs {@code BaseUnit} instances.
*
* @since 2019-10-16
+ * @since v0.3.0
*/
Unit(final NameSymbol nameSymbol) {
if (this instanceof BaseUnit) {
@@ -128,6 +135,7 @@ public abstract class Unit implements Nameable {
* @param unitBase base of unit
* @param ns names and symbol of unit
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if unitBase or ns is null
*/
protected Unit(ObjectProduct<BaseUnit> unitBase, NameSymbol ns) {
@@ -187,6 +195,7 @@ public abstract class Unit implements Nameable {
* @param value value to convert
* @return converted value
* @since 2019-05-22
+ * @since v0.3.0
* @throws IllegalArgumentException if {@code other} is incompatible for
* conversion with this unit (as tested by
* {@link Unit#canConvertTo}).
@@ -255,6 +264,7 @@ public abstract class Unit implements Nameable {
/**
* @return the nameSymbol
* @since 2020-09-07
+ * @since v0.3.0
*/
@Override
public final NameSymbol getNameSymbol() {
@@ -281,6 +291,7 @@ public abstract class Unit implements Nameable {
* @return true iff this unit is metric.
*
* @since 2020-08-27
+ * @since v0.3.0
*/
public final boolean isMetric() {
// first condition - check that it is a linear unit
@@ -302,6 +313,7 @@ public abstract class Unit implements Nameable {
/**
* @return a string representing this unit's definition
* @since 2022-03-10
+ * @since v0.3.0
*/
public String toDefinitionString() {
if (!this.unitBase.getNameSymbol().isEmpty())
@@ -314,6 +326,7 @@ public abstract class Unit implements Nameable {
/**
* @return a string containing both this unit's name and its definition
* @since 2022-03-10
+ * @since v0.3.0
*/
public final String toFullString() {
return this.toString() + " (" + this.toDefinitionString() + ")";
@@ -333,6 +346,7 @@ public abstract class Unit implements Nameable {
* @param ns name(s) and symbol to use
* @return a copy of this unit with provided name(s) and symbol
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if ns is null
*/
public Unit withName(final NameSymbol ns) {
diff --git a/src/main/java/sevenUnits/unit/UnitDatabase.java b/src/main/java/sevenUnits/unit/UnitDatabase.java
index 6cf794b..b0d026f 100644
--- a/src/main/java/sevenUnits/unit/UnitDatabase.java
+++ b/src/main/java/sevenUnits/unit/UnitDatabase.java
@@ -138,6 +138,7 @@ public final class UnitDatabase {
/**
* @since 2019-05-03
+ * @since v0.3.0
*/
@Override
public boolean equals(final Object o) {
@@ -160,6 +161,7 @@ public final class UnitDatabase {
/**
* @since 2019-05-03
+ * @since v0.3.0
*/
@Override
public int hashCode() {
@@ -181,6 +183,7 @@ public final class UnitDatabase {
* value.
*
* @since 2019-05-03
+ * @since v0.3.0
*/
@Override
public String toString() {
@@ -307,6 +310,7 @@ public final class UnitDatabase {
* @return the next element in the iterator, without iterating over
* it
* @since 2019-05-03
+ * @since v0.3.0
*/
private Entry<String, Unit> peek() {
if (!this.hasNext())
@@ -333,6 +337,7 @@ public final class UnitDatabase {
* of the representation are unspecified and subject to change.
*
* @since 2019-05-03
+ * @since v0.3.0
*/
@Override
public String toString() {
@@ -622,6 +627,7 @@ public final class UnitDatabase {
* @return the next element in the iterator, without iterating over
* it
* @since 2019-05-03
+ * @since v0.3.0
*/
private String peek() {
if (!this.hasNext())
@@ -645,6 +651,7 @@ public final class UnitDatabase {
* of the representation are unspecified and subject to change.
*
* @since 2019-05-03
+ * @since v0.3.0
*/
@Override
public String toString() {
@@ -1136,6 +1143,7 @@ public final class UnitDatabase {
* @param exponentUnit exponent
* @return result
* @since 2020-08-04
+ * @since v0.3.0
*/
private static final LinearUnitValue exponentiateUnitValues(
final LinearUnitValue base, final LinearUnitValue exponentValue) {
@@ -1151,6 +1159,7 @@ public final class UnitDatabase {
/**
* @return true if entry represents a removable duplicate entry of map.
* @since 2021-05-22
+ * @since v0.3.0
*/
static <T> boolean isRemovableDuplicate(Map<String, T> map,
Entry<String, T> entry) {
@@ -1236,6 +1245,7 @@ public final class UnitDatabase {
* A parser that can parse unit value expressions.
*
* @since 2020-08-04
+ * @since v0.3.0
*/
private final ExpressionParser<LinearUnitValue> unitValueExpressionParser = new ExpressionParser.Builder<>(
this::getLinearUnitValue)
@@ -1297,6 +1307,7 @@ public final class UnitDatabase {
* @param prefixRepetitionRule the rule that determines when prefix
* repetition is allowed
* @since 2020-08-26
+ * @since v0.3.0
*/
public UnitDatabase(Predicate<List<UnitPrefix>> prefixRepetitionRule) {
this.prefixlessUnits = new HashMap<>();
@@ -1468,6 +1479,7 @@ public final class UnitDatabase {
* @param name name of unit set
* @param value unit set to add
* @since 2024-08-16
+ * @since v1.0.0
*/
public void addUnitSet(String name, List<LinearUnit> value) {
if (value.isEmpty())
@@ -1486,6 +1498,7 @@ public final class UnitDatabase {
* Removes all units, unit sets, prefixes and dimensions from this database.
*
* @since 2022-02-26
+ * @since v0.4.0
*/
public void clear() {
this.dimensions.clear();
@@ -1538,6 +1551,7 @@ public final class UnitDatabase {
* @return true iff there is a unit set with this name
*
* @since 2024-08-16
+ * @since v1.0.0
*/
public boolean containsUnitSetName(String name) {
return this.unitSets.containsKey(name);
@@ -1559,6 +1573,7 @@ public final class UnitDatabase {
* @param expression expression to parse
* @return {@code LinearUnitValue} representing value of expression
* @since 2020-08-04
+ * @since v0.3.0
*/
public LinearUnitValue evaluateUnitExpression(final String expression) {
Objects.requireNonNull(expression, "expression must not be null.");
@@ -1697,6 +1712,7 @@ public final class UnitDatabase {
* @param name name of unit
* @return {@code LinearUnitValue} instance
* @since 2020-08-04
+ * @since v0.3.0
*/
LinearUnitValue getLinearUnitValue(final String name) {
try {
@@ -1735,6 +1751,7 @@ public final class UnitDatabase {
* @param unitName name of unit
* @return prefixes
* @since 2020-08-26
+ * @since v0.3.0
*/
List<UnitPrefix> getPrefixesFromName(final String unitName) {
final List<UnitPrefix> prefixes = new ArrayList<>();
@@ -1800,6 +1817,7 @@ public final class UnitDatabase {
/**
* @return the prefixRepetitionRule
* @since 2020-08-26
+ * @since v0.3.0
*/
public final Predicate<List<UnitPrefix>> getPrefixRepetitionRule() {
return this.prefixRepetitionRule;
@@ -1904,6 +1922,7 @@ public final class UnitDatabase {
* @return unit set with that name
*
* @since 2024-08-16
+ * @since v1.0.0
*/
public List<LinearUnit> getUnitSet(String name) {
final List<LinearUnit> unitSet = this.unitSets.get(name);
@@ -1916,6 +1935,7 @@ public final class UnitDatabase {
* Parses a semicolon-separated expression to get the unit set being used.
*
* @since 2024-08-22
+ * @since v1.0.0
*/
List<LinearUnit> getUnitSetFromExpression(String expression) {
final String[] parts = expression.split(";");
@@ -1991,6 +2011,7 @@ public final class UnitDatabase {
* @param stream stream to load from
* @return list of all errors that happened loading the stream
* @since 2021-03-27
+ * @since v0.3.0
*/
public List<LoadingException> loadDimensionsFromStream(
final InputStream stream) {
@@ -2062,6 +2083,7 @@ public final class UnitDatabase {
* @param stream stream to load from
* @return list of all errors that happened loading the stream
* @since 2021-03-27
+ * @since v0.3.0
*/
public List<LoadingException> loadUnitsFromStream(InputStream stream) {
final List<LoadingException> errors = new ArrayList<>();
@@ -2098,6 +2120,7 @@ public final class UnitDatabase {
/**
* @param prefixRepetitionRule the prefixRepetitionRule to set
* @since 2020-08-26
+ * @since v0.3.0
*/
public final void setPrefixRepetitionRule(
Predicate<List<UnitPrefix>> prefixRepetitionRule) {
@@ -2169,6 +2192,7 @@ public final class UnitDatabase {
/**
* @return an unmodifiable map mapping names to unit sets
* @since 2024-08-16
+ * @since v1.0.0
*/
public Map<String, List<LinearUnit>> unitSetMap() {
return Collections.unmodifiableMap(this.unitSets);
diff --git a/src/main/java/sevenUnits/unit/UnitPrefix.java b/src/main/java/sevenUnits/unit/UnitPrefix.java
index 6ac9128..0fd3421 100644
--- a/src/main/java/sevenUnits/unit/UnitPrefix.java
+++ b/src/main/java/sevenUnits/unit/UnitPrefix.java
@@ -28,6 +28,7 @@ import sevenUnits.utils.Nameable;
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
public final class UnitPrefix implements Nameable {
/**
@@ -36,6 +37,7 @@ public final class UnitPrefix implements Nameable {
* @param multiplier multiplier of prefix
* @return prefix
* @since 2019-10-16
+ * @since v0.3.0
*/
public static UnitPrefix valueOf(final double multiplier) {
return new UnitPrefix(multiplier, NameSymbol.EMPTY);
@@ -48,6 +50,7 @@ public final class UnitPrefix implements Nameable {
* @param ns name(s) and symbol of prefix
* @return prefix
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if ns is null
*/
public static UnitPrefix valueOf(final double multiplier,
@@ -60,6 +63,7 @@ public final class UnitPrefix implements Nameable {
* This prefix's name(s) and symbol.
*
* @since 2022-04-16
+ * @since v0.4.0
*/
private final NameSymbol nameSymbol;
@@ -67,6 +71,7 @@ public final class UnitPrefix implements Nameable {
* The number that this prefix multiplies units by
*
* @since 2019-10-16
+ * @since v0.3.0
*/
private final double multiplier;
@@ -88,6 +93,7 @@ public final class UnitPrefix implements Nameable {
* @param divisor number to divide by
* @return quotient of prefix and scalar
* @since 2019-10-16
+ * @since v0.3.0
*/
public UnitPrefix dividedBy(final double divisor) {
return valueOf(this.getMultiplier() / divisor);
@@ -143,6 +149,7 @@ public final class UnitPrefix implements Nameable {
/**
* @return prefix's multiplier
* @since 2019-11-26
+ * @since v0.3.0
*/
public double getMultiplier() {
return this.multiplier;
@@ -169,6 +176,7 @@ public final class UnitPrefix implements Nameable {
* @param multiplicand number to multiply by
* @return product of prefix and scalar
* @since 2019-10-16
+ * @since v0.3.0
*/
public UnitPrefix times(final double multiplicand) {
return valueOf(this.getMultiplier() * multiplicand);
@@ -180,6 +188,7 @@ public final class UnitPrefix implements Nameable {
* @return sum of prefixes
*
* @since 2024-03-03
+ * @since v0.5.0
*/
public UnitPrefix plus(final UnitPrefix other) {
return valueOf(this.getMultiplier() + other.getMultiplier());
@@ -191,6 +200,7 @@ public final class UnitPrefix implements Nameable {
* @return difference of prefixes
*
* @since 2024-03-03
+ * @since v0.5.0
*/
public UnitPrefix minus(final UnitPrefix other) {
return valueOf(this.getMultiplier() - other.getMultiplier());
@@ -239,6 +249,7 @@ public final class UnitPrefix implements Nameable {
* @param ns name(s) and symbol to use
* @return copy of this prefix with provided name(s) and symbol
* @since 2019-11-26
+ * @since v0.3.0
* @throws NullPointerException if ns is null
*/
public UnitPrefix withName(final NameSymbol ns) {
diff --git a/src/main/java/sevenUnits/unit/UnitType.java b/src/main/java/sevenUnits/unit/UnitType.java
index d445418..a331d3d 100644
--- a/src/main/java/sevenUnits/unit/UnitType.java
+++ b/src/main/java/sevenUnits/unit/UnitType.java
@@ -30,6 +30,7 @@ import java.util.function.Predicate;
* </ul>
*
* @since 2022-04-10
+ * @since v0.4.0
*/
public enum UnitType {
/** Units that pass {@link Unit#isMetric} */
@@ -51,6 +52,7 @@ public enum UnitType {
* @param isSemiMetric predicate to determine if a unit is semi-metric
* @return type of unit
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final UnitType getType(Unit u, Predicate<Unit> isSemiMetric) {
if (isSemiMetric.test(u))
diff --git a/src/main/java/sevenUnits/unit/UnitValue.java b/src/main/java/sevenUnits/unit/UnitValue.java
index 97b7e54..4003c17 100644
--- a/src/main/java/sevenUnits/unit/UnitValue.java
+++ b/src/main/java/sevenUnits/unit/UnitValue.java
@@ -29,6 +29,7 @@ import sevenUnits.utils.NameSymbol;
*
* @author Adrien Hopkins
* @since 2020-07-26
+ * @since v0.3.0
*/
public final class UnitValue {
/**
@@ -59,6 +60,7 @@ public final class UnitValue {
* @param other unit to try to convert to
* @return true if this value can be converted to {@code other}.
* @since 2020-10-01
+ * @since v0.3.0
*/
public final boolean canConvertTo(Unit other) {
return this.unit.canConvertTo(other);
@@ -84,6 +86,7 @@ public final class UnitValue {
* needed.
* @return this unit as a {@link LinearUnitValue}
* @since 2020-09-29
+ * @since v0.3.0
*/
public final LinearUnitValue convertToBase(NameSymbol ns) {
final LinearUnit base = LinearUnit.getBase(this.unit).withName(ns);
@@ -95,6 +98,7 @@ public final class UnitValue {
* @return a {@code LinearUnitValue} that is equivalent to this value. It
* will have zero uncertainty.
* @since 2020-09-29
+ * @since v0.3.0
*/
public final LinearUnitValue convertToLinear(LinearUnit newUnit) {
return LinearUnitValue.getExact(newUnit,
@@ -121,6 +125,7 @@ public final class UnitValue {
/**
* @return the unit
* @since 2020-09-29
+ * @since v0.3.0
*/
public final Unit getUnit() {
return this.unit;
@@ -129,6 +134,7 @@ public final class UnitValue {
/**
* @return the value
* @since 2020-09-29
+ * @since v0.3.0
*/
public final double getValue() {
return this.value;
diff --git a/src/main/java/sevenUnits/utils/ConditionalExistenceCollections.java b/src/main/java/sevenUnits/utils/ConditionalExistenceCollections.java
index b46e821..dd21a22 100644
--- a/src/main/java/sevenUnits/utils/ConditionalExistenceCollections.java
+++ b/src/main/java/sevenUnits/utils/ConditionalExistenceCollections.java
@@ -53,6 +53,7 @@ import java.util.function.Predicate;
*
* @author Adrien Hopkins
* @since 2019-10-17
+ * @since v0.3.0
*/
public final class ConditionalExistenceCollections {
/**
@@ -60,6 +61,7 @@ public final class ConditionalExistenceCollections {
*
* @author Adrien Hopkins
* @since 2019-10-17
+ * @since v0.3.0
* @param <E> type of element in collection
*/
static final class ConditionalExistenceCollection<E>
@@ -73,6 +75,7 @@ public final class ConditionalExistenceCollections {
* @param collection
* @param existenceCondition
* @since 2019-10-17
+ * @since v0.3.0
*/
private ConditionalExistenceCollection(final Collection<E> collection,
final Predicate<E> existenceCondition) {
@@ -149,6 +152,7 @@ public final class ConditionalExistenceCollections {
*
* @author Adrien Hopkins
* @since 2019-10-17
+ * @since v0.3.0
* @param <E> type of elements in iterator
*/
static final class ConditionalExistenceIterator<E> implements Iterator<E> {
@@ -163,6 +167,7 @@ public final class ConditionalExistenceCollections {
* @param iterator
* @param condition
* @since 2019-10-17
+ * @since v0.3.0
*/
private ConditionalExistenceIterator(final Iterator<E> iterator,
final Predicate<E> condition) {
@@ -175,6 +180,7 @@ public final class ConditionalExistenceCollections {
* Gets the next element, and sets nextElement and hasNext accordingly.
*
* @since 2019-10-17
+ * @since v0.3.0
*/
private void getAndSetNextElement() {
do {
@@ -214,6 +220,7 @@ public final class ConditionalExistenceCollections {
*
* @author Adrien Hopkins
* @since 2019-10-17
+ * @since v0.3.0
* @param <K> key type
* @param <V> value type
*/
@@ -227,6 +234,7 @@ public final class ConditionalExistenceCollections {
* @param map
* @param entryExistenceCondition
* @since 2019-10-17
+ * @since v0.3.0
*/
private ConditionalExistenceMap(final Map<K, V> map,
final Predicate<Entry<K, V>> entryExistenceCondition) {
@@ -313,6 +321,7 @@ public final class ConditionalExistenceCollections {
*
* @author Adrien Hopkins
* @since 2019-10-17
+ * @since v0.3.0
* @param <E> type of element in set
*/
static final class ConditionalExistenceSet<E> extends AbstractSet<E> {
@@ -325,6 +334,7 @@ public final class ConditionalExistenceCollections {
* @param set set to use
* @param existenceCondition condition where element exists
* @since 2019-10-17
+ * @since v0.3.0
*/
private ConditionalExistenceSet(final Set<E> set,
final Predicate<E> existenceCondition) {
@@ -410,6 +420,7 @@ public final class ConditionalExistenceCollections {
* @param existenceCondition elements only exist if this returns true
* @return wrapper collection
* @since 2019-10-17
+ * @since v0.3.0
*/
public static final <E> Collection<E> conditionalExistenceCollection(
final Collection<E> collection,
@@ -427,6 +438,7 @@ public final class ConditionalExistenceCollections {
* @param existenceCondition elements only exist if this returns true
* @return wrapper iterator
* @since 2019-10-17
+ * @since v0.3.0
*/
public static final <E> Iterator<E> conditionalExistenceIterator(
final Iterator<E> iterator, final Predicate<E> existenceCondition) {
@@ -443,6 +455,7 @@ public final class ConditionalExistenceCollections {
* @param entryExistenceCondition mappings only exist if this returns true
* @return wrapper map
* @since 2019-10-17
+ * @since v0.3.0
*/
public static final <K, V> Map<K, V> conditionalExistenceMap(
final Map<K, V> map,
@@ -459,6 +472,7 @@ public final class ConditionalExistenceCollections {
* @param existenceCondition elements only exist if this returns true
* @return wrapper set
* @since 2019-10-17
+ * @since v0.3.0
*/
public static final <E> Set<E> conditionalExistenceSet(final Set<E> set,
final Predicate<E> existenceCondition) {
diff --git a/src/main/java/sevenUnits/utils/DecimalComparison.java b/src/main/java/sevenUnits/utils/DecimalComparison.java
index 4136818..c7564c4 100644
--- a/src/main/java/sevenUnits/utils/DecimalComparison.java
+++ b/src/main/java/sevenUnits/utils/DecimalComparison.java
@@ -193,6 +193,7 @@ public final class DecimalComparison {
* @param b second value to test
* @return whether they are equal
* @since 2020-09-07
+ * @since v0.3.0
*/
public static final boolean equals(final UncertainDouble a,
final UncertainDouble b) {
diff --git a/src/main/java/sevenUnits/utils/ExpressionParser.java b/src/main/java/sevenUnits/utils/ExpressionParser.java
index 8ab6c95..1c8df9f 100644
--- a/src/main/java/sevenUnits/utils/ExpressionParser.java
+++ b/src/main/java/sevenUnits/utils/ExpressionParser.java
@@ -87,6 +87,7 @@ public final class ExpressionParser<T> {
* A map mapping operator strings to numeric functions.
*
* @since 2024-03-23
+ * @since v0.5.0
*/
private final Map<String, PriorityBiFunction<T, UncertainDouble, T>> numericOperators;
@@ -526,6 +527,7 @@ public final class ExpressionParser<T> {
* A map mapping operator strings to numeric functions.
*
* @since 2024-03-23
+ * @since v0.5.0
*/
private final Map<String, PriorityBiFunction<T, UncertainDouble, T>> numericOperators;
diff --git a/src/main/java/sevenUnits/utils/NameSymbol.java b/src/main/java/sevenUnits/utils/NameSymbol.java
index c0c8f94..ebb1e8b 100644
--- a/src/main/java/sevenUnits/utils/NameSymbol.java
+++ b/src/main/java/sevenUnits/utils/NameSymbol.java
@@ -29,6 +29,7 @@ import java.util.Set;
*
* @author Adrien Hopkins
* @since 2019-10-21
+ * @since v0.3.0
*/
public final class NameSymbol {
/** The {@code NameSymbol} with all fields empty. */
@@ -67,6 +68,7 @@ public final class NameSymbol {
* @param symbol symbol to use
* @return NameSymbol instance
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if name or symbol is null
*/
public static final NameSymbol of(final String name, final String symbol) {
@@ -83,6 +85,7 @@ public final class NameSymbol {
* @param otherNames other names to use
* @return NameSymbol instance
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if any argument is null
*/
public static final NameSymbol of(final String name, final String symbol,
@@ -101,6 +104,7 @@ public final class NameSymbol {
* @param otherNames other names to use
* @return NameSymbol instance
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if any argument is null
*/
public static final NameSymbol of(final String name, final String symbol,
@@ -117,6 +121,7 @@ public final class NameSymbol {
* @param name name to use
* @return NameSymbol instance
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if name is null
*/
public static final NameSymbol ofName(final String name) {
@@ -140,6 +145,7 @@ public final class NameSymbol {
* @param otherNames other names to use
* @return NameSymbol instance
* @since 2019-11-26
+ * @since v0.3.0
*/
public static final NameSymbol ofNullable(final String name,
final String symbol, final Set<String> otherNames) {
@@ -163,6 +169,7 @@ public final class NameSymbol {
* @param otherNames other names to use
* @return NameSymbol instance
* @since 2019-11-26
+ * @since v0.3.0
*/
public static final NameSymbol ofNullable(final String name,
final String symbol, final String... otherNames) {
@@ -176,6 +183,7 @@ public final class NameSymbol {
* @param symbol symbol to use
* @return NameSymbol instance
* @since 2019-10-21
+ * @since v0.3.0
* @throws NullPointerException if symbol is null
*/
public static final NameSymbol ofSymbol(final String symbol) {
@@ -196,6 +204,7 @@ public final class NameSymbol {
* @param otherNames other names and/or spellings, should be a mutable copy
* of the argument
* @since 2019-10-21
+ * @since v0.3.0
*/
NameSymbol(final Optional<String> primaryName,
final Optional<String> symbol, final Set<String> otherNames) {
@@ -241,6 +250,7 @@ public final class NameSymbol {
/**
* @return otherNames
* @since 2019-10-21
+ * @since v0.3.0
*/
public final Set<String> getOtherNames() {
return this.otherNames;
@@ -249,6 +259,7 @@ public final class NameSymbol {
/**
* @return primaryName
* @since 2019-10-21
+ * @since v0.3.0
*/
public final Optional<String> getPrimaryName() {
return this.primaryName;
@@ -257,6 +268,7 @@ public final class NameSymbol {
/**
* @return symbol
* @since 2019-10-21
+ * @since v0.3.0
*/
public final Optional<String> getSymbol() {
return this.symbol;
@@ -302,8 +314,8 @@ public final class NameSymbol {
* @param name additional name to add
* @return copy of this NameSymbol with the additional name
*
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
public final NameSymbol withExtraName(String name) {
if (this.primaryName.isPresent()) {
diff --git a/src/main/java/sevenUnits/utils/Nameable.java b/src/main/java/sevenUnits/utils/Nameable.java
index 15026b7..efd1ab8 100644
--- a/src/main/java/sevenUnits/utils/Nameable.java
+++ b/src/main/java/sevenUnits/utils/Nameable.java
@@ -24,12 +24,14 @@ import java.util.Set;
* and symbol data should be immutable.
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public interface Nameable {
/**
* @return a name for the object - if there's a primary name, it's that,
* otherwise the symbol, otherwise "Unnamed"
* @since 2022-02-26
+ * @since v0.4.0
*/
default String getName() {
final NameSymbol ns = this.getNameSymbol();
@@ -40,12 +42,14 @@ public interface Nameable {
* @return a {@code NameSymbol} that contains this object's primary name,
* symbol and other names
* @since 2020-09-07
+ * @since v0.3.0
*/
NameSymbol getNameSymbol();
/**
* @return set of alternate names
* @since 2020-09-07
+ * @since v0.3.0
*/
default Set<String> getOtherNames() {
return this.getNameSymbol().getOtherNames();
@@ -54,6 +58,7 @@ public interface Nameable {
/**
* @return preferred name of object
* @since 2020-09-07
+ * @since v0.3.0
*/
default Optional<String> getPrimaryName() {
return this.getNameSymbol().getPrimaryName();
@@ -63,6 +68,7 @@ public interface Nameable {
* @return a short name for the object - if there's a symbol, it's that,
* otherwise the symbol, otherwise "Unnamed"
* @since 2022-02-26
+ * @since v0.4.0
*/
default String getShortName() {
final NameSymbol ns = this.getNameSymbol();
@@ -72,6 +78,7 @@ public interface Nameable {
/**
* @return short symbol representing object
* @since 2020-09-07
+ * @since v0.3.0
*/
default Optional<String> getSymbol() {
return this.getNameSymbol().getSymbol();
diff --git a/src/main/java/sevenUnits/utils/ObjectProduct.java b/src/main/java/sevenUnits/utils/ObjectProduct.java
index 772ff5e..1b8832e 100644
--- a/src/main/java/sevenUnits/utils/ObjectProduct.java
+++ b/src/main/java/sevenUnits/utils/ObjectProduct.java
@@ -33,6 +33,7 @@ import java.util.function.Function;
* @author Adrien Hopkins
* @param <T> type of object that is being multiplied
* @since 2019-10-16
+ * @since v0.3.0
*/
public class ObjectProduct<T> implements Nameable {
/**
@@ -47,6 +48,7 @@ public class ObjectProduct<T> implements Nameable {
* @param <T> type of objects that can be multiplied
* @return empty product
* @since 2019-10-16
+ * @since v0.3.0
*/
public static final <T> ObjectProduct<T> empty() {
return new ObjectProduct<>(new HashMap<>());
@@ -59,6 +61,7 @@ public class ObjectProduct<T> implements Nameable {
* @param map map mapping objects to exponents
* @return object product
* @since 2019-10-16
+ * @since v0.3.0
*/
public static final <T> ObjectProduct<T> fromExponentMapping(
final Map<T, Integer> map) {
@@ -73,6 +76,7 @@ public class ObjectProduct<T> implements Nameable {
* @param <T> type of object contained in returned ObjectProduct
* @return product
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if object is null
*/
public static final <T> ObjectProduct<T> oneOf(final T object) {
@@ -87,6 +91,7 @@ public class ObjectProduct<T> implements Nameable {
* treats zero as null, and is immutable.
*
* @since 2019-10-16
+ * @since v0.3.0
*/
final Map<T, Integer> exponents;
@@ -100,6 +105,7 @@ public class ObjectProduct<T> implements Nameable {
*
* @param exponents objects that make up this product
* @since 2019-10-16
+ * @since v0.3.0
*/
ObjectProduct(final Map<T, Integer> exponents) {
this(exponents, NameSymbol.EMPTY);
@@ -111,6 +117,7 @@ public class ObjectProduct<T> implements Nameable {
* @param exponents objects that make up this product
* @param nameSymbol name and symbol of object product
* @since 2019-10-16
+ * @since v0.3.0
*/
ObjectProduct(final Map<T, Integer> exponents, NameSymbol nameSymbol) {
this.exponents = Collections.unmodifiableMap(
@@ -125,6 +132,7 @@ public class ObjectProduct<T> implements Nameable {
* @param other other product
* @return quotient of two products
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if other is null
*/
public ObjectProduct<T> dividedBy(final ObjectProduct<T> other) {
@@ -158,6 +166,7 @@ public class ObjectProduct<T> implements Nameable {
/**
* @return immutable map mapping objects to exponents
* @since 2019-10-16
+ * @since v0.3.0
*/
public Map<T, Integer> exponentMap() {
return this.exponents;
@@ -209,6 +218,7 @@ public class ObjectProduct<T> implements Nameable {
* @return true if this product is a single object, i.e. it has one exponent
* of one and no other nonzero exponents
* @since 2019-10-16
+ * @since v0.3.0
*/
public boolean isSingleObject() {
int oneCount = 0;
@@ -229,6 +239,7 @@ public class ObjectProduct<T> implements Nameable {
* @param other other product
* @return product of two products
* @since 2019-10-16
+ * @since v0.3.0
* @throws NullPointerException if other is null
*/
public ObjectProduct<T> times(final ObjectProduct<T> other) {
@@ -254,6 +265,7 @@ public class ObjectProduct<T> implements Nameable {
* @param exponent exponent
* @return result of exponentiation
* @since 2019-10-16
+ * @since v0.3.0
*/
public ObjectProduct<T> toExponent(final int exponent) {
final Map<T, Integer> map = new HashMap<>(this.exponents);
@@ -274,6 +286,7 @@ public class ObjectProduct<T> implements Nameable {
* @return result of exponentiation
*
* @since 2024-08-22
+ * @since v0.3.0
*/
public ObjectProduct<T> toExponentRounded(final double exponent) {
final Map<T, Integer> map = new HashMap<>(this.exponents);
@@ -315,6 +328,7 @@ public class ObjectProduct<T> implements Nameable {
* @param objectToString function to convert objects to strings
* @return string representation of product
* @since 2019-10-16
+ * @since v0.3.0
*/
public String toString(final Function<T, String> objectToString) {
final List<String> positiveStringComponents = new ArrayList<>();
@@ -347,6 +361,7 @@ public class ObjectProduct<T> implements Nameable {
* @return named version of this {@code ObjectProduct}, using data from
* {@code nameSymbol}
* @since 2021-12-15
+ * @since v0.3.0
*/
public ObjectProduct<T> withName(NameSymbol nameSymbol) {
return new ObjectProduct<>(this.exponents, nameSymbol);
diff --git a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
index bf198ae..cde3d37 100644
--- a/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
+++ b/src/main/java/sevenUnits/utils/SemanticVersionNumber.java
@@ -39,8 +39,8 @@ import java.util.regex.Pattern;
* are made
* </ol>
*
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public final class SemanticVersionNumber
implements Comparable<SemanticVersionNumber> {
@@ -52,8 +52,8 @@ public final class SemanticVersionNumber
* throw NullPointerExceptions, everything else throws
* IllegalArgumentException.
*
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static final class Builder {
private final int major;
@@ -69,8 +69,8 @@ public final class SemanticVersionNumber
* @param major major version number of final version
* @param minor minor version number of final version
* @param patch patch version number of final version
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
private Builder(int major, int minor, int patch) {
this.major = major;
@@ -82,8 +82,8 @@ public final class SemanticVersionNumber
/**
* @return version number created by this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public SemanticVersionNumber build() {
return new SemanticVersionNumber(this.major, this.minor, this.patch,
@@ -95,8 +95,8 @@ public final class SemanticVersionNumber
*
* @param identifiers build metadata
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder buildMetadata(List<String> identifiers) {
Objects.requireNonNull(identifiers, "identifiers may not be null");
@@ -115,8 +115,8 @@ public final class SemanticVersionNumber
*
* @param identifiers build metadata
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder buildMetadata(String... identifiers) {
Objects.requireNonNull(identifiers, "identifiers may not be null");
@@ -154,8 +154,8 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder preRelease(int... identifiers) {
Objects.requireNonNull(identifiers, "identifiers may not be null");
@@ -173,8 +173,8 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder preRelease(List<String> identifiers) {
Objects.requireNonNull(identifiers, "identifiers may not be null");
@@ -193,8 +193,8 @@ public final class SemanticVersionNumber
*
* @param identifiers pre-release identifier(s) to add
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder preRelease(String... identifiers) {
Objects.requireNonNull(identifiers, "identifiers may not be null");
@@ -214,8 +214,8 @@ public final class SemanticVersionNumber
* @param identifier1 first identifier
* @param identifier2 second identifier
* @return this builder
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public Builder preRelease(String identifier1, int identifier2) {
Objects.requireNonNull(identifier1, "identifier1 may not be null");
@@ -280,8 +280,8 @@ public final class SemanticVersionNumber
* @param patch patch version number of final version
* @return version number builder
* @throws IllegalArgumentException if any argument is negative
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static final SemanticVersionNumber.Builder builder(int major,
int minor, int patch) {
@@ -304,8 +304,8 @@ public final class SemanticVersionNumber
* @param b second list
* @return result of comparison as in a comparator
* @see Comparator
- * @since v0.4.0
* @since 2022-02-20
+ * @since v0.4.0
*/
private static final int compareIdentifiers(List<String> a, List<String> b) {
// test pre-release size
@@ -365,8 +365,8 @@ public final class SemanticVersionNumber
*
* @param versionString string to parse
* @return {@code SemanticVersionNumber} instance
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
* @see #toString
*/
public static final SemanticVersionNumber fromString(String versionString) {
@@ -409,8 +409,8 @@ public final class SemanticVersionNumber
*
* @param versionString string to test
* @return true iff string is valid
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static final boolean isValidVersionString(String versionString) {
return VERSION_NUMBER.matcher(versionString).matches();
@@ -429,8 +429,8 @@ public final class SemanticVersionNumber
* @throws IllegalArgumentException if any argument is negative or if the
* preReleaseType is null, empty or not
* alphanumeric (0-9, A-Z, a-z, - only)
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static final SemanticVersionNumber preRelease(int major, int minor,
int patch, String preReleaseType, int preReleaseNumber) {
@@ -467,8 +467,8 @@ public final class SemanticVersionNumber
* @param patch patch version number
* @return {@code SemanticVersionNumber} instance
* @throws IllegalArgumentException if any argument is negative
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static final SemanticVersionNumber stableVersion(int major, int minor,
int patch) {
@@ -500,8 +500,8 @@ public final class SemanticVersionNumber
* @param patch patch version number
* @param preReleaseIdentifiers pre-release version data
* @param buildMetadata build metadata
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
private SemanticVersionNumber(int major, int minor, int patch,
List<String> preReleaseIdentifiers, List<String> buildMetadata) {
@@ -514,8 +514,8 @@ public final class SemanticVersionNumber
/**
* @return build metadata (empty if there is none)
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public List<String> buildMetadata() {
return Collections.unmodifiableList(this.buildMetadata);
@@ -585,8 +585,8 @@ public final class SemanticVersionNumber
* @param other version to compare with
* @return true if you can definitely upgrade to {@code other} without
* changing code
- * @since v0.4.0
* @since 2022-02-20
+ * @since v0.4.0
*/
public boolean compatibleWith(SemanticVersionNumber other) {
Objects.requireNonNull(other, "other may not be null");
@@ -639,8 +639,8 @@ public final class SemanticVersionNumber
/**
* @return true iff this version is stable (major version > 0 and not a
* pre-release)
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public boolean isStable() {
return this.major > 0 && this.preReleaseIdentifiers.isEmpty();
@@ -649,8 +649,8 @@ public final class SemanticVersionNumber
/**
* @return the MAJOR version number, incremented when you make backwards
* incompatible API changes
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public int majorVersion() {
return this.major;
@@ -659,8 +659,8 @@ public final class SemanticVersionNumber
/**
* @return the MINOR version number, incremented when you add backwards
* compatible functionality
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public int minorVersion() {
return this.minor;
@@ -669,8 +669,8 @@ public final class SemanticVersionNumber
/**
* @return the PATCH version number, incremented when you make backwards
* compatible bug fixes
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public int patchVersion() {
return this.patch;
@@ -679,8 +679,8 @@ public final class SemanticVersionNumber
/**
* @return identifiers describing this pre-release (empty if not a
* pre-release)
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public List<String> preReleaseIdentifiers() {
return Collections.unmodifiableList(this.preReleaseIdentifiers);
diff --git a/src/main/java/sevenUnits/utils/UncertainDouble.java b/src/main/java/sevenUnits/utils/UncertainDouble.java
index 46803d1..f700454 100644
--- a/src/main/java/sevenUnits/utils/UncertainDouble.java
+++ b/src/main/java/sevenUnits/utils/UncertainDouble.java
@@ -29,6 +29,7 @@ import java.util.regex.Pattern;
* arguments is null.
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final class UncertainDouble implements Comparable<UncertainDouble> {
/**
@@ -56,6 +57,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @throws NumberFormatException if the argument is not a number
*
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final UncertainDouble fromRoundedString(String s) {
final BigDecimal value = new BigDecimal(s);
@@ -75,6 +77,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return {@code UncertainDouble} instance
* @throws IllegalArgumentException if the string is invalid
* @since 2020-09-07
+ * @since v0.3.0
*/
public static final UncertainDouble fromString(String s) {
Objects.requireNonNull(s, "s may not be null");
@@ -116,6 +119,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return {@code UncertainDouble} instance with these parameters
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public static final UncertainDouble of(double value, double uncertainty) {
return new UncertainDouble(value, uncertainty);
@@ -132,6 +136,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return {@code UncertainDouble} instance with these parameters
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public static final UncertainDouble ofRelative(double value,
double relativeUncertainty) {
@@ -146,6 +151,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @param value
* @param uncertainty
* @since 2020-09-07
+ * @since v0.3.0
*/
private UncertainDouble(double value, double uncertainty) {
this.value = value;
@@ -178,6 +184,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return quotient
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble dividedBy(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -192,6 +199,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return quotient
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble dividedByExact(double other) {
return UncertainDouble.of(this.value / other, this.uncertainty / other);
@@ -216,6 +224,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return true iff this and {@code other} are within each other's
* uncertainty range.
* @since 2020-09-07
+ * @since v0.3.0
*/
public final boolean equivalent(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -227,6 +236,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* Gets the preferred scale for rounding a value for toString.
*
* @since 2020-09-07
+ * @since v0.3.0
*/
private final int getDisplayScale() {
// round based on uncertainty
@@ -263,6 +273,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return true iff the value has no uncertainty
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final boolean isExact() {
return this.uncertainty == 0;
@@ -275,6 +286,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of subtraction
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble minus(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -289,6 +301,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of subtraction
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble minusExact(double other) {
return UncertainDouble.of(this.value - other, this.uncertainty);
@@ -301,6 +314,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of addition
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble plus(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -315,6 +329,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of addition
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble plusExact(double other) {
return UncertainDouble.of(this.value + other, this.uncertainty);
@@ -323,6 +338,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
/**
* @return relative uncertainty
* @since 2020-09-07
+ * @since v0.3.0
*/
public final double relativeUncertainty() {
return this.uncertainty / this.value;
@@ -335,6 +351,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return product
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble times(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -349,6 +366,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return product
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble timesExact(double other) {
return UncertainDouble.of(this.value * other, this.uncertainty * other);
@@ -361,6 +379,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of exponentation
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble toExponent(UncertainDouble other) {
Objects.requireNonNull(other, "other may not be null");
@@ -381,6 +400,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return result of exponentation
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final UncertainDouble toExponentExact(double other) {
return UncertainDouble.ofRelative(Math.pow(this.value, other),
@@ -404,6 +424,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* </pre>
*
* @since 2020-09-07
+ * @since v0.3.0
*/
@Override
public final String toString() {
@@ -441,6 +462,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
* @return string representation of this {@code UncertainDouble}
*
* @since 2020-09-07
+ * @since v0.3.0
*/
public final String toString(boolean showUncertainty,
RoundingMode roundingMode) {
@@ -473,6 +495,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
/**
* @return absolute uncertainty
* @since 2020-09-07
+ * @since v0.3.0
*/
public final double uncertainty() {
return this.uncertainty;
@@ -481,6 +504,7 @@ public final class UncertainDouble implements Comparable<UncertainDouble> {
/**
* @return value without uncertainty
* @since 2020-09-07
+ * @since v0.3.0
*/
public final double value() {
return this.value;
diff --git a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
index fbf78a3..97df107 100644
--- a/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
+++ b/src/main/java/sevenUnitsGUI/DefaultPrefixRepetitionRule.java
@@ -26,6 +26,7 @@ import sevenUnits.unit.UnitPrefix;
* A rule that specifies whether prefix repetition is allowed
*
* @since 2020-08-26
+ * @since v0.3.0
*/
public enum DefaultPrefixRepetitionRule implements Predicate<List<UnitPrefix>> {
/** Prefix repetition is never allowed; only one prefix may be used. */
diff --git a/src/main/java/sevenUnitsGUI/DelegateListModel.java b/src/main/java/sevenUnitsGUI/DelegateListModel.java
index 4925197..200eee2 100644
--- a/src/main/java/sevenUnitsGUI/DelegateListModel.java
+++ b/src/main/java/sevenUnitsGUI/DelegateListModel.java
@@ -56,6 +56,7 @@ final class DelegateListModel<E> extends AbstractListModel<E>
* Creates an empty {@code DelegateListModel}.
*
* @since 2019-04-13
+ * @since v0.2.0
*/
public DelegateListModel() {
this(new ArrayList<>());
diff --git a/src/main/java/sevenUnitsGUI/ExpressionConversionView.java b/src/main/java/sevenUnitsGUI/ExpressionConversionView.java
index ead07c5..20eb23c 100644
--- a/src/main/java/sevenUnitsGUI/ExpressionConversionView.java
+++ b/src/main/java/sevenUnitsGUI/ExpressionConversionView.java
@@ -20,21 +20,21 @@ package sevenUnitsGUI;
* A View that can convert unit expressions
*
* @author Adrien Hopkins
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
public interface ExpressionConversionView extends View {
/**
* @return unit expression to convert <em>from</em>
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
String getFromExpression();
/**
* @return unit expression to convert <em>to</em>
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
String getToExpression();
@@ -42,8 +42,8 @@ public interface ExpressionConversionView extends View {
* Shows the output of an expression conversion to the user.
*
* @param uc unit conversion to show
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
void showExpressionConversionOutput(UnitConversionRecord uc);
}
diff --git a/src/main/java/sevenUnitsGUI/Main.java b/src/main/java/sevenUnitsGUI/Main.java
index b573a09..3ff2fd9 100644
--- a/src/main/java/sevenUnitsGUI/Main.java
+++ b/src/main/java/sevenUnitsGUI/Main.java
@@ -19,8 +19,8 @@ package sevenUnitsGUI;
/**
* The main code for the 7Units GUI
*
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
public final class Main {
@@ -28,8 +28,8 @@ public final class Main {
* The main method that starts 7Units
*
* @param args commandline arguments
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
public static void main(String[] args) {
View.createTabbedView();
diff --git a/src/main/java/sevenUnitsGUI/PrefixSearchRule.java b/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
index 1937fd2..2ea0923 100644
--- a/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
+++ b/src/main/java/sevenUnitsGUI/PrefixSearchRule.java
@@ -34,8 +34,8 @@ import sevenUnits.unit.UnitPrefix;
* A search rule that applies a certain set of prefixes to a unit. It always
* includes the original unit in the output map.
*
- * @since v0.4.0
* @since 2022-07-06
+ * @since v0.4.0
*/
public final class PrefixSearchRule implements
Function<Map.Entry<String, LinearUnit>, Map<String, LinearUnit>> {
@@ -70,8 +70,8 @@ public final class PrefixSearchRule implements
*
* @param prefixes prefixes to apply
* @return prefix rule
- * @since v0.4.0
* @since 2022-07-06
+ * @since v0.4.0
*/
public static final PrefixSearchRule getCoherentOnlyRule(
Set<UnitPrefix> prefixes) {
@@ -84,8 +84,8 @@ public final class PrefixSearchRule implements
*
* @param prefixes prefixes to apply
* @return prefix rule
- * @since v0.4.0
* @since 2022-07-06
+ * @since v0.4.0
*/
public static final PrefixSearchRule getUniversalRule(
Set<UnitPrefix> prefixes) {
@@ -106,8 +106,8 @@ public final class PrefixSearchRule implements
* @param prefixes prefixes to add to units
* @param prefixableUnitRule function that determines which units get
* prefixes
- * @since v0.4.0
* @since 2022-07-06
+ * @since v0.4.0
*/
public PrefixSearchRule(Set<UnitPrefix> prefixes,
Predicate<LinearUnit> prefixableUnitRule) {
@@ -143,8 +143,8 @@ public final class PrefixSearchRule implements
/**
* @return rule that determines which units get prefixes
- * @since v0.4.0
* @since 2022-07-09
+ * @since v0.4.0
*/
public Predicate<LinearUnit> getPrefixableUnitRule() {
return this.prefixableUnitRule;
@@ -152,8 +152,8 @@ public final class PrefixSearchRule implements
/**
* @return the prefixes that are applied by this rule
- * @since v0.4.0
* @since 2022-07-06
+ * @since v0.4.0
*/
public Set<UnitPrefix> getPrefixes() {
return this.prefixes;
diff --git a/src/main/java/sevenUnitsGUI/Presenter.java b/src/main/java/sevenUnitsGUI/Presenter.java
index 7c66d55..ff7e23c 100644
--- a/src/main/java/sevenUnitsGUI/Presenter.java
+++ b/src/main/java/sevenUnitsGUI/Presenter.java
@@ -60,6 +60,7 @@ import sevenUnitsGUI.StandardDisplayRules.UncertaintyBased;
*
* @author Adrien Hopkins
* @since 2021-12-15
+ * @since v0.4.0
*/
public final class Presenter {
/**
@@ -139,6 +140,7 @@ public final class Presenter {
* {@code maxLineLength}. If no good spot is found, returns -1.
*
* @since 2024-08-22
+ * @since v1.0.0
*/
private static int findLineSplit(String toWrap, int maxLineLength) {
for (var i = maxLineLength - 1; i >= 0; i--) {
@@ -155,6 +157,7 @@ public final class Presenter {
* @param filename filename to get resource from
* @return contents of file
* @since 2021-03-27
+ * @since v0.3.0
*/
private static List<String> getLinesFromResource(String filename) {
final List<String> lines = new ArrayList<>();
@@ -178,6 +181,7 @@ public final class Presenter {
* @param filepath file to use as resource
* @return obtained Path
* @since 2021-03-27
+ * @since v0.3.0
*/
private static InputStream inputStream(String filepath) {
return Presenter.class.getResourceAsStream(filepath);
@@ -188,6 +192,7 @@ public final class Presenter {
* the nearest integer.
*
* @since 2024-08-16
+ * @since v1.0.0
*/
private static String linearUnitValueIntToString(LinearUnitValue uv) {
return Long.toString(Math.round(uv.getValueExact())) + " " + uv.getUnit();
@@ -227,6 +232,7 @@ public final class Presenter {
/**
* @return true iff a and b have any elements in common
* @since 2022-04-19
+ * @since v0.4.0
*/
private static boolean sharesAnyElements(Set<?> a, Set<?> b) {
for (final Object e : a) {
@@ -254,6 +260,7 @@ public final class Presenter {
/**
* @return {@code line} with any comments removed.
* @since 2021-03-13
+ * @since v0.3.0
*/
private static String withoutComments(String line) {
final var index = line.indexOf('#');
@@ -264,6 +271,7 @@ public final class Presenter {
* Wraps a string, ensuring no line is longer than {@code maxLineLength}.
*
* @since 2024-08-22
+ * @since v1.0.0
*/
private static String wrapString(String toWrap, int maxLineLength) {
final var wrapped = new StringBuilder(toWrap.length());
@@ -366,6 +374,7 @@ public final class Presenter {
*
* @param view the view that this presenter communicates with
* @since 2021-12-15
+ * @since v0.4.0
*/
public Presenter(View view) {
this.view = view;
@@ -449,6 +458,7 @@ public final class Presenter {
* @param e entry
* @return stream of entries, ready for flat-mapping
* @since 2022-07-06
+ * @since v0.4.0
*/
private Stream<Map.Entry<String, Unit>> applySearchRule(
Map.Entry<String, Unit> e) {
@@ -472,6 +482,7 @@ public final class Presenter {
* not implement
* {@link ExpressionConversionView})
* @since 2021-12-15
+ * @since v0.4.0
*/
public void convertExpressions() {
if (!(this.view instanceof ExpressionConversionView))
@@ -515,6 +526,7 @@ public final class Presenter {
* returned.
*
* @since 2024-08-15
+ * @since v1.0.0
*/
private Optional<UnitConversionRecord> convertExpressionToExpression(
String fromExpression, String toExpression) {
@@ -567,6 +579,7 @@ public final class Presenter {
* the view and Optional.empty() is returned.
*
* @since 2024-08-15
+ * @since v1.0.0
*/
private Optional<UnitConversionRecord> convertExpressionToMultiUnit(
String fromExpression, String[] toExpressions) {
@@ -617,6 +630,7 @@ public final class Presenter {
* error happened, it is shown to the view and Optional.empty() is returned.
*
* @since 2024-08-15
+ * @since v1.0.0
*/
private Optional<UnitConversionRecord> convertExpressionToNamedMultiUnit(
String fromExpression, String toName) {
@@ -653,6 +667,7 @@ public final class Presenter {
* implement
* {@link UnitConversionView})
* @since 2021-12-15
+ * @since v0.4.0
*/
public void convertUnits() {
if (!(this.view instanceof UnitConversionView))
@@ -770,6 +785,7 @@ public final class Presenter {
/**
* @return true iff duplicate units are shown in unit lists
* @since 2022-03-30
+ * @since v0.4.0
*/
public boolean duplicatesShown() {
return this.showDuplicates;
@@ -778,6 +794,7 @@ public final class Presenter {
/**
* @return text in About file
* @since 2022-02-19
+ * @since v0.4.0
*/
public String getAboutText() {
final Path customFilepath = Presenter.pathFromConfig(
@@ -809,6 +826,7 @@ public final class Presenter {
/**
* @return set of all locales available to select
* @since 2025-02-21
+ * @since v1.0.0
*/
public Set<String> getAvailableLocales() {
return this.locales.keySet();
@@ -820,6 +838,7 @@ public final class Presenter {
* @param dimension dimension to name
* @return name of dimension
* @since 2022-04-16
+ * @since v0.4.0
*/
String getDimensionName(ObjectProduct<BaseDimension> dimension) {
// find this dimension in the database and get its name
@@ -847,6 +866,7 @@ public final class Presenter {
* @return the rule that is used by this presenter to convert numbers into
* strings
* @since 2022-04-10
+ * @since v0.4.0
*/
public Function<UncertainDouble, String> getNumberDisplayRule() {
return this.numberDisplayRule;
@@ -856,6 +876,7 @@ public final class Presenter {
* @return the rule that is used by this presenter to convert strings into
* numbers
* @since 2022-04-10
+ * @since v0.4.0
*/
@SuppressWarnings("unused") // not implemented yet
private Function<String, UncertainDouble> getNumberParsingRule() {
@@ -865,6 +886,7 @@ public final class Presenter {
/**
* @return the rule that determines whether a set of prefixes is valid
* @since 2022-04-19
+ * @since v0.4.0
*/
public Predicate<List<UnitPrefix>> getPrefixRepetitionRule() {
return this.prefixRepetitionRule;
@@ -873,6 +895,7 @@ public final class Presenter {
/**
* @return the rule that determines which units are prefixed
* @since 2022-07-08
+ * @since v0.4.0
*/
public Function<Map.Entry<String, LinearUnit>, Map<String, LinearUnit>> getSearchRule() {
return this.searchRule;
@@ -881,6 +904,7 @@ public final class Presenter {
/**
* @return a search rule that shows all single prefixes
* @since 2022-07-08
+ * @since v0.4.0
*/
public Function<Map.Entry<String, LinearUnit>, Map<String, LinearUnit>> getUniversalSearchRule() {
return PrefixSearchRule.getCoherentOnlyRule(
@@ -890,6 +914,7 @@ public final class Presenter {
/**
* @return user's selected locale
* @since 2025-02-21
+ * @since v1.0.0
*/
public String getUserLocale() {
return userLocale;
@@ -898,6 +923,7 @@ public final class Presenter {
/**
* @return the view associated with this presenter
* @since 2022-04-19
+ * @since v0.4.0
*/
public View getView() {
return this.view;
@@ -908,6 +934,7 @@ public final class Presenter {
* message and alerts the user.
*
* @since 2024-08-22
+ * @since v1.0.0
*/
private void handleLoadErrors(List<LoadingException> errors) {
if (!errors.isEmpty()) {
@@ -925,6 +952,7 @@ public final class Presenter {
* @return whether or not the provided unit is semi-metric (i.e. an
* exception)
* @since 2022-04-16
+ * @since v0.4.0
*/
boolean isSemiMetric(Unit u) {
// determine if u is an exception
@@ -944,6 +972,7 @@ public final class Presenter {
* number display rule.
*
* @since 2024-08-16
+ * @since v1.0.0
*/
private String linearUnitValueSumToString(List<LinearUnitValue> values) {
final var integerPart = values.subList(0, values.size() - 1).stream()
@@ -1018,6 +1047,7 @@ public final class Presenter {
*
* @param settingsFile file settings should be loaded from
* @since 2021-12-15
+ * @since v0.4.0
*/
void loadSettings(Path settingsFile) {
this.customDimensionFiles.clear();
@@ -1086,6 +1116,7 @@ public final class Presenter {
/**
* @return a message showing how much stuff has been loaded
* @since 2024-08-22
+ * @since v1.0.0
*/
private String loadStatMsg() {
return this.getLocalizedText("load_stat_msg")
@@ -1107,6 +1138,7 @@ public final class Presenter {
* unit list and imperial/USC units removed from the To unit list)
*
* @since 2022-03-30
+ * @since v0.4.0
*/
public boolean oneWayConversionEnabled() {
return this.oneWayConversionEnabled;
@@ -1118,6 +1150,7 @@ public final class Presenter {
* they depend on are not created yet.
*
* @since 2022-02-26
+ * @since v0.4.0
*/
public void postViewInitialize() {
// unit conversion specific stuff
@@ -1148,6 +1181,7 @@ public final class Presenter {
*
* @return false iff the presenter could not write to the file
* @since 2022-04-19
+ * @since v0.4.0
*/
public boolean saveSettings() {
final var configDir = CONFIG_FILE.getParent();
@@ -1187,6 +1221,7 @@ public final class Presenter {
* @param numberDisplayRule the new rule that will be used by this presenter
* to convert numbers into strings
* @since 2022-04-10
+ * @since v0.4.0
*/
public void setNumberDisplayRule(
Function<UncertainDouble, String> numberDisplayRule) {
@@ -1197,6 +1232,7 @@ public final class Presenter {
* @param numberParsingRule the new rule that will be used by this presenter
* to convert strings into numbers
* @since 2022-04-10
+ * @since v0.4.0
*/
@SuppressWarnings("unused") // not implemented yet
private void setNumberParsingRule(
@@ -1208,6 +1244,7 @@ public final class Presenter {
* @param oneWayConversionEnabled whether not one-way conversion should be
* enabled
* @since 2022-03-30
+ * @since v0.4.0
* @see #oneWayConversionEnabled
*/
public void setOneWayConversionEnabled(boolean oneWayConversionEnabled) {
@@ -1219,6 +1256,7 @@ public final class Presenter {
* @param prefixRepetitionRule the rule that determines whether a set of
* prefixes is valid
* @since 2022-04-19
+ * @since v0.4.0
*/
public void setPrefixRepetitionRule(
Predicate<List<UnitPrefix>> prefixRepetitionRule) {
@@ -1232,6 +1270,7 @@ public final class Presenter {
* unit (including the unit itself) that should be
* searchable.
* @since 2022-07-08
+ * @since v0.4.0
*/
public void setSearchRule(
Function<Map.Entry<String, LinearUnit>, Map<String, LinearUnit>> searchRule) {
@@ -1259,6 +1298,7 @@ public final class Presenter {
/**
* @param showDuplicateUnits whether or not duplicate units should be shown
* @since 2022-03-30
+ * @since v0.4.0
*/
public void setShowDuplicates(boolean showDuplicateUnits) {
this.showDuplicates = showDuplicateUnits;
@@ -1304,6 +1344,7 @@ public final class Presenter {
*
* @param u unit to show
* @since 2022-04-16
+ * @since v0.4.0
*/
private void showUnit(Unit u) {
final var nameSymbol = u.getNameSymbol();
@@ -1320,6 +1361,7 @@ public final class Presenter {
* description of a unit and displays it.
*
* @since 2022-04-10
+ * @since v0.4.0
*/
void unitNameSelected() {
// get selected unit, if it's there and valid
@@ -1335,6 +1377,7 @@ public final class Presenter {
* Updates the view's From and To units, if it has some
*
* @since 2021-12-15
+ * @since v0.4.0
*/
public void updateView() {
if (this.view instanceof UnitConversionView) {
@@ -1402,6 +1445,7 @@ public final class Presenter {
* @return AssertionError stating that an error has happened in the view's
* code
* @since 2022-04-09
+ * @since v0.4.0
*/
private AssertionError viewError(String message, Object... args) {
return new AssertionError("View Programming Error (from " + this.view
@@ -1413,6 +1457,7 @@ public final class Presenter {
*
* @param settingsFile file settings should be saved to
* @since 2021-12-15
+ * @since v0.4.0
*/
boolean writeSettings(Path settingsFile) {
try (var writer = Files.newBufferedWriter(settingsFile)) {
diff --git a/src/main/java/sevenUnitsGUI/SearchBoxList.java b/src/main/java/sevenUnitsGUI/SearchBoxList.java
index 1748083..43a57ce 100644
--- a/src/main/java/sevenUnitsGUI/SearchBoxList.java
+++ b/src/main/java/sevenUnitsGUI/SearchBoxList.java
@@ -84,6 +84,7 @@ final class SearchBoxList<E> extends JPanel {
* Creates an empty SearchBoxList
*
* @since 2022-02-19
+ * @since v0.4.0
*/
public SearchBoxList() {
this(List.of(), null, false);
@@ -94,6 +95,7 @@ final class SearchBoxList<E> extends JPanel {
*
* @param itemsToFilter items to put in the list
* @since 2019-04-14
+ * @since v0.2.0
*/
public SearchBoxList(final Collection<E> itemsToFilter) {
this(itemsToFilter, null, false);
@@ -170,6 +172,7 @@ final class SearchBoxList<E> extends JPanel {
* @return items available in search list, including items that are hidden by
* the search filter
* @since 2022-03-30
+ * @since v0.4.0
*/
public Collection<E> getItems() {
return Collections.unmodifiableCollection(this.itemsToFilter);
@@ -323,6 +326,7 @@ final class SearchBoxList<E> extends JPanel {
*
* @param newItems new items to put in list
* @since 2021-05-22
+ * @since v0.3.0
*/
public void setItems(Collection<? extends E> newItems) {
this.itemsToFilter.clear();
@@ -334,6 +338,7 @@ final class SearchBoxList<E> extends JPanel {
* Manually updates the search box's item list.
*
* @since 2020-08-27
+ * @since v0.3.0
*/
public void updateList() {
this.searchBoxTextChanged();
diff --git a/src/main/java/sevenUnitsGUI/StandardDisplayRules.java b/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
index a19b680..d710117 100644
--- a/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
+++ b/src/main/java/sevenUnitsGUI/StandardDisplayRules.java
@@ -28,15 +28,15 @@ import sevenUnits.utils.UncertainDouble;
* A static utility class that can be used to make display rules for the
* presenter.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public final class StandardDisplayRules {
/**
* A rule that rounds to a fixed number of decimal places.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final class FixedDecimals
implements Function<UncertainDouble, String> {
@@ -51,6 +51,7 @@ public final class StandardDisplayRules {
/**
* @param decimalPlaces
* @since 2022-04-18
+ * @since v0.4.0
*/
private FixedDecimals(int decimalPlaces) {
this.decimalPlaces = decimalPlaces;
@@ -66,6 +67,7 @@ public final class StandardDisplayRules {
/**
* @return the number of decimal places this rule rounds to
* @since 2022-04-18
+ * @since v0.4.0
*/
public int decimalPlaces() {
return this.decimalPlaces;
@@ -97,8 +99,8 @@ public final class StandardDisplayRules {
/**
* A rule that rounds to a fixed number of significant digits.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final class FixedPrecision
implements Function<UncertainDouble, String> {
@@ -114,6 +116,7 @@ public final class StandardDisplayRules {
/**
* @param significantFigures
* @since 2022-04-18
+ * @since v0.4.0
*/
private FixedPrecision(int significantFigures) {
this.mathContext = new MathContext(significantFigures,
@@ -150,6 +153,7 @@ public final class StandardDisplayRules {
/**
* @return the number of significant figures this rule rounds to
* @since 2022-04-18
+ * @since v0.4.0
*/
public int significantFigures() {
return this.mathContext.getPrecision();
@@ -167,8 +171,8 @@ public final class StandardDisplayRules {
* This means the output will have around as many significant figures as the
* input.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final class UncertaintyBased
implements Function<UncertainDouble, String> {
@@ -195,8 +199,8 @@ public final class StandardDisplayRules {
/**
* @param decimalPlaces decimal places to round to
* @return a rounding rule that rounds to fixed number of decimal places
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final FixedDecimals fixedDecimals(int decimalPlaces) {
return new FixedDecimals(decimalPlaces);
@@ -206,8 +210,8 @@ public final class StandardDisplayRules {
* @param significantFigures significant figures to round to
* @return a rounding rule that rounds to a fixed number of significant
* figures
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final FixedPrecision fixedPrecision(int significantFigures) {
return new FixedPrecision(significantFigures);
@@ -220,8 +224,8 @@ public final class StandardDisplayRules {
* @return display rule
* @throws IllegalArgumentException if the provided string is not that of a
* standard rule.
- * @since v0.4.0
* @since 2021-12-24
+ * @since v0.4.0
*/
public static final Function<UncertainDouble, String> getStandardRule(
String ruleToString) {
@@ -246,8 +250,8 @@ public final class StandardDisplayRules {
/**
* @return an UncertainDouble-based rounding rule
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
public static final UncertaintyBased uncertaintyBased() {
return UNCERTAINTY_BASED_ROUNDING_RULE;
diff --git a/src/main/java/sevenUnitsGUI/TabbedView.java b/src/main/java/sevenUnitsGUI/TabbedView.java
index 97b93dc..1afaf33 100644
--- a/src/main/java/sevenUnitsGUI/TabbedView.java
+++ b/src/main/java/sevenUnitsGUI/TabbedView.java
@@ -67,8 +67,8 @@ import sevenUnits.utils.UncertainDouble;
/**
* A View that separates its functions into multiple tabs
*
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
@@ -76,8 +76,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
*
* @param <E> type of item in list
*
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
private static final class JComboBoxItemSet<E> extends AbstractSet<E> {
private final JComboBox<E> comboBox;
@@ -85,6 +85,7 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
* @param comboBox combo box to get items from
* @since 2022-02-19
+ * @since v0.4.0
*/
public JComboBoxItemSet(JComboBox<E> comboBox) {
this.comboBox = comboBox;
@@ -122,8 +123,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
* The standard types of rounding, corresponding to the options on the
* TabbedView's settings panel.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
private static enum StandardRoundingType {
/**
@@ -147,8 +148,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
* Creates a TabbedView.
*
* @param args command line arguments
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public static void main(String[] args) {
// This view doesn't need to do anything, the side effects of creating it
@@ -209,8 +210,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
* Creates the view and makes it visible to the user
*
- * @since v0.4.0
* @since 2022-02-19
+ * @since v0.4.0
*/
public TabbedView() {
// enable system look and feel
@@ -401,6 +402,7 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
* code more organized, as this function is massive!)
*
* @since 2022-02-19
+ * @since v0.4.0
*/
private JPanel createSettingsPanel() {
final JPanel settingsPanel = new JPanel();
@@ -737,8 +739,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
* @return the precision of the presenter's rounding rule, if that is
* meaningful
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
private OptionalInt getPresenterPrecision() {
final var presenterRule = this.presenter.getNumberDisplayRule();
@@ -756,8 +758,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
* @return presenter's prefix repetition rule
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
private Optional<DefaultPrefixRepetitionRule> getPresenterPrefixRule() {
final var prefixRule = this.presenter.getPrefixRepetitionRule();
@@ -769,8 +771,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
/**
* Determines which rounding type the presenter is currently using, if any.
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
private Optional<StandardRoundingType> getPresenterRoundingType() {
final var presenterRule = this.presenter.getNumberDisplayRule();
@@ -881,8 +883,8 @@ final class TabbedView implements ExpressionConversionView, UnitConversionView {
* Sets the presenter's rounding rule to the one specified by the current
* settings
*
- * @since v0.4.0
* @since 2022-04-18
+ * @since v0.4.0
*/
private void updatePresenterRoundingRule() {
final Function<UncertainDouble, String> roundingRule;
diff --git a/src/main/java/sevenUnitsGUI/UnitConversionRecord.java b/src/main/java/sevenUnitsGUI/UnitConversionRecord.java
index 6dde230..958deae 100644
--- a/src/main/java/sevenUnitsGUI/UnitConversionRecord.java
+++ b/src/main/java/sevenUnitsGUI/UnitConversionRecord.java
@@ -24,8 +24,8 @@ import sevenUnits.unit.UnitValue;
/**
* A record of a conversion between units or expressions
*
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public final class UnitConversionRecord {
/**
@@ -34,8 +34,8 @@ public final class UnitConversionRecord {
* @param input input unit &amp; value
* @param output output unit &amp; value
* @return unit conversion record
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public static UnitConversionRecord fromLinearValues(LinearUnitValue input,
LinearUnitValue output) {
@@ -51,8 +51,8 @@ public final class UnitConversionRecord {
* @param input input unit &amp; value
* @param output output unit &amp; value
* @return unit conversion record
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public static UnitConversionRecord fromValues(UnitValue input,
UnitValue output) {
@@ -70,8 +70,8 @@ public final class UnitConversionRecord {
* @param inputValueString string representing input value
* @param outputValueString string representing output value
* @return unit conversion record
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public static UnitConversionRecord valueOf(String fromName, String toName,
String inputValueString, String outputValueString) {
@@ -106,6 +106,7 @@ public final class UnitConversionRecord {
* @param inputValueString string representing input value
* @param outputValueString string representing output value
* @since 2022-04-09
+ * @since v0.4.0
*/
private UnitConversionRecord(String fromName, String toName,
String inputValueString, String outputValueString) {
@@ -147,8 +148,8 @@ public final class UnitConversionRecord {
/**
* @return name of unit or expression that was converted from
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public String fromName() {
return this.fromName;
@@ -171,8 +172,8 @@ public final class UnitConversionRecord {
/**
* @return string representing input value
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public String inputValueString() {
return this.inputValueString;
@@ -180,8 +181,8 @@ public final class UnitConversionRecord {
/**
* @return string representing output value
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public String outputValueString() {
return this.outputValueString;
@@ -189,8 +190,8 @@ public final class UnitConversionRecord {
/**
* @return name of unit or expression that was converted to
- * @since v0.4.0
* @since 2022-04-09
+ * @since v0.4.0
*/
public String toName() {
return this.toName;
diff --git a/src/main/java/sevenUnitsGUI/UnitConversionView.java b/src/main/java/sevenUnitsGUI/UnitConversionView.java
index a6cc399..c7ffda4 100644
--- a/src/main/java/sevenUnitsGUI/UnitConversionView.java
+++ b/src/main/java/sevenUnitsGUI/UnitConversionView.java
@@ -23,57 +23,57 @@ import java.util.Set;
* A View that supports single unit-based conversion
*
* @author Adrien Hopkins
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
public interface UnitConversionView extends View {
/**
* @return dimensions available for filtering
- * @since v0.4.0
* @since 2022-01-29
+ * @since v0.4.0
*/
Set<String> getDimensionNames();
/**
* @return name of unit to convert <em>from</em>
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
Optional<String> getFromSelection();
/**
* @return list of names of units available to convert from
- * @since v0.4.0
* @since 2022-03-30
+ * @since v0.4.0
*/
Set<String> getFromUnitNames();
/**
* @return value to convert between the units (specifically, the numeric
* string provided by the user)
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
String getInputValue();
/**
* @return selected dimension
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
Optional<String> getSelectedDimensionName();
/**
* @return name of unit to convert <em>to</em>
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
Optional<String> getToSelection();
/**
* @return list of names of units available to convert to
- * @since v0.4.0
* @since 2022-03-30
+ * @since v0.4.0
*/
Set<String> getToUnitNames();
@@ -81,8 +81,8 @@ public interface UnitConversionView extends View {
* Sets the available dimensions for filtering.
*
* @param dimensionNames names of dimensions to use
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
void setDimensionNames(Set<String> dimensionNames);
@@ -92,8 +92,8 @@ public interface UnitConversionView extends View {
* that allow the user to select units from a list.
*
* @param unitNames names of units to convert from
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
void setFromUnitNames(Set<String> unitNames);
@@ -103,8 +103,8 @@ public interface UnitConversionView extends View {
* that allow the user to select units from a list.
*
* @param unitNames names of units to convert to
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
void setToUnitNames(Set<String> unitNames);
@@ -112,8 +112,8 @@ public interface UnitConversionView extends View {
* Shows the output of a unit conversion.
*
* @param uc record of unit conversion
- * @since v0.4.0
* @since 2021-12-24
+ * @since v0.4.0
*/
void showUnitConversionOutput(UnitConversionRecord uc);
}
diff --git a/src/main/java/sevenUnitsGUI/View.java b/src/main/java/sevenUnitsGUI/View.java
index f934bb5..fc04593 100644
--- a/src/main/java/sevenUnitsGUI/View.java
+++ b/src/main/java/sevenUnitsGUI/View.java
@@ -26,14 +26,14 @@ import sevenUnits.utils.NameSymbol;
* An object that controls user interaction with 7Units
*
* @author Adrien Hopkins
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
public interface View {
/**
* @return a new tabbed view
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
static View createTabbedView() {
return new TabbedView();
@@ -41,22 +41,22 @@ public interface View {
/**
* @return the presenter associated with this view
- * @since v0.4.0
* @since 2022-04-19
+ * @since v0.4.0
*/
Presenter getPresenter();
/**
* @return name of prefix currently being viewed
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
Optional<String> getViewedPrefixName();
/**
* @return name of unit currently being viewed
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
Optional<String> getViewedUnitName();
@@ -65,8 +65,8 @@ public interface View {
* viewer
*
* @param prefixNames prefix names to view
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
void setViewablePrefixNames(Set<String> prefixNames);
@@ -74,8 +74,8 @@ public interface View {
* Sets the list of units that are available to be viewed in a unit viewer
*
* @param unitNames unit names to view
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
void setViewableUnitNames(Set<String> unitNames);
@@ -85,8 +85,8 @@ public interface View {
* @param title title of error message; on any view that uses an error
* dialog, this should be the title of the error dialog.
* @param message error message
- * @since v0.4.0
* @since 2021-12-15
+ * @since v0.4.0
*/
void showErrorMessage(String title, String message);
@@ -95,8 +95,8 @@ public interface View {
*
* @param name name(s) and symbol of prefix
* @param multiplierString string representation of prefix multiplier
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
void showPrefix(NameSymbol name, String multiplierString);
@@ -107,8 +107,8 @@ public interface View {
* @param definition unit's definition string
* @param dimensionName name of unit's dimension
* @param type type of unit (metric/semi-metric/non-metric)
- * @since v0.4.0
* @since 2022-04-10
+ * @since v0.4.0
*/
void showUnit(NameSymbol name, String definition, String dimensionName,
UnitType type);
diff --git a/src/main/java/sevenUnitsGUI/ViewBot.java b/src/main/java/sevenUnitsGUI/ViewBot.java
index 8e24e64..689b460 100644
--- a/src/main/java/sevenUnitsGUI/ViewBot.java
+++ b/src/main/java/sevenUnitsGUI/ViewBot.java
@@ -32,8 +32,8 @@ import sevenUnits.utils.Nameable;
* for testing. Getters and setters work as expected.
*
* @author Adrien Hopkins
- * @since v0.4.0
* @since 2022-01-29
+ * @since v0.4.0
*/
public final class ViewBot
implements UnitConversionView, ExpressionConversionView {
@@ -42,6 +42,7 @@ public final class ViewBot
* {@link View#showPrefix(NameSymbol, String)}, for testing.
*
* @since 2022-04-16
+ * @since v0.4.0
*/
public static final class PrefixViewingRecord implements Nameable {
private final NameSymbol nameSymbol;
@@ -51,6 +52,7 @@ public final class ViewBot
* @param nameSymbol
* @param multiplierString
* @since 2022-04-16
+ * @since v0.4.0
*/
public PrefixViewingRecord(NameSymbol nameSymbol,
String multiplierString) {
@@ -106,6 +108,7 @@ public final class ViewBot
* {@link View#showUnit(NameSymbol, String, String, UnitType)}, for testing.
*
* @since 2022-04-16
+ * @since v0.4.0
*/
public static final class UnitViewingRecord implements Nameable {
private final NameSymbol nameSymbol;
@@ -119,6 +122,7 @@ public final class ViewBot
* @param dimensionName name of unit's dimension
* @param unitType type of unit (metric/semi-metric/non-metric)
* @since 2022-04-16
+ * @since v0.4.0
*/
public UnitViewingRecord(NameSymbol nameSymbol, String definition,
String dimensionName, UnitType unitType) {
@@ -131,6 +135,7 @@ public final class ViewBot
/**
* @return the definition
* @since 2022-04-16
+ * @since v0.4.0
*/
public String definition() {
return this.definition;
@@ -139,6 +144,7 @@ public final class ViewBot
/**
* @return the dimensionName
* @since 2022-04-16
+ * @since v0.4.0
*/
public String dimensionName() {
return this.dimensionName;
@@ -160,6 +166,7 @@ public final class ViewBot
/**
* @return the nameSymbol
* @since 2022-04-16
+ * @since v0.4.0
*/
@Override
public NameSymbol getNameSymbol() {
@@ -195,6 +202,7 @@ public final class ViewBot
/**
* @return the unitType
* @since 2022-04-16
+ * @since v0.4.0
*/
public UnitType unitType() {
return this.unitType;
@@ -243,6 +251,7 @@ public final class ViewBot
* Creates a new {@code ViewBot} with a new presenter.
*
* @since 2022-01-29
+ * @since v0.4.0
*/
public ViewBot() {
this.presenter = new Presenter(this);
@@ -256,6 +265,7 @@ public final class ViewBot
/**
* @return list of records of expression conversions done by this bot
* @since 2022-04-09
+ * @since v0.4.0
*/
public List<UnitConversionRecord> expressionConversionList() {
return Collections.unmodifiableList(this.expressionConversions);
@@ -264,6 +274,7 @@ public final class ViewBot
/**
* @return the available dimensions
* @since 2022-01-29
+ * @since v0.4.0
*/
@Override
public Set<String> getDimensionNames() {
@@ -283,6 +294,7 @@ public final class ViewBot
/**
* @return the units available for selection in From
* @since 2022-01-29
+ * @since v0.4.0
*/
@Override
public Set<String> getFromUnitNames() {
@@ -297,6 +309,7 @@ public final class ViewBot
/**
* @return the presenter associated with tihs view
* @since 2022-01-29
+ * @since v0.4.0
*/
@Override
public Presenter getPresenter() {
@@ -321,6 +334,7 @@ public final class ViewBot
/**
* @return the units available for selection in To
* @since 2022-01-29
+ * @since v0.4.0
*/
@Override
public Set<String> getToUnitNames() {
@@ -340,6 +354,7 @@ public final class ViewBot
/**
* @return list of records of this viewBot's prefix views
* @since 2022-04-16
+ * @since v0.4.0
*/
public List<PrefixViewingRecord> prefixViewList() {
return Collections.unmodifiableList(this.prefixViewingRecords);
@@ -357,6 +372,7 @@ public final class ViewBot
* @param fromExpression the expression to convert from
* @throws NullPointerException if {@code fromExpression} is null
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setFromExpression(String fromExpression) {
this.fromExpression = Objects.requireNonNull(fromExpression,
@@ -366,6 +382,7 @@ public final class ViewBot
/**
* @param fromSelection the fromSelection to set
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setFromSelection(Optional<String> fromSelection) {
this.fromSelection = Objects.requireNonNull(fromSelection,
@@ -375,6 +392,7 @@ public final class ViewBot
/**
* @param fromSelection the fromSelection to set
* @since 2022-02-10
+ * @since v0.4.0
*/
public void setFromSelection(String fromSelection) {
this.setFromSelection(Optional.of(fromSelection));
@@ -388,6 +406,7 @@ public final class ViewBot
/**
* @param inputValue the inputValue to set
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setInputValue(String inputValue) {
this.inputValue = inputValue;
@@ -396,6 +415,7 @@ public final class ViewBot
/**
* @param selectedDimensionName the selectedDimensionName to set
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setSelectedDimensionName(
Optional<String> selectedDimensionName) {
@@ -416,6 +436,7 @@ public final class ViewBot
* @param toExpression the expression to convert to
* @throws NullPointerException if {@code toExpression} is null
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setToExpression(String toExpression) {
this.toExpression = Objects.requireNonNull(toExpression,
@@ -425,6 +446,7 @@ public final class ViewBot
/**
* @param toSelection unit set in the 'To' selection
* @since 2022-01-29
+ * @since v0.4.0
*/
public void setToSelection(Optional<String> toSelection) {
this.toSelection = Objects.requireNonNull(toSelection,
@@ -521,6 +543,7 @@ public final class ViewBot
/**
* @return list of records of every unit conversion made by this bot
* @since 2022-04-09
+ * @since v0.4.0
*/
public List<UnitConversionRecord> unitConversionList() {
return Collections.unmodifiableList(this.unitConversions);
@@ -529,6 +552,7 @@ public final class ViewBot
/**
* @return list of records of unit viewings made by this bot
* @since 2022-04-16
+ * @since v0.4.0
*/
public List<UnitViewingRecord> unitViewList() {
return Collections.unmodifiableList(this.unitViewingRecords);
diff --git a/src/main/java/sevenUnitsGUI/package-info.java b/src/main/java/sevenUnitsGUI/package-info.java
index c0ccc1b..74ec18c 100644
--- a/src/main/java/sevenUnitsGUI/package-info.java
+++ b/src/main/java/sevenUnitsGUI/package-info.java
@@ -19,5 +19,6 @@
*
* @author Adrien Hopkins
* @since 2021-12-15
+ * @since v0.4.0
*/
package sevenUnitsGUI; \ No newline at end of file
diff --git a/src/test/java/sevenUnits/unit/UnitDatabaseTest.java b/src/test/java/sevenUnits/unit/UnitDatabaseTest.java
index 56296b4..c78837f 100644
--- a/src/test/java/sevenUnits/unit/UnitDatabaseTest.java
+++ b/src/test/java/sevenUnits/unit/UnitDatabaseTest.java
@@ -60,6 +60,7 @@ class UnitDatabaseTest {
/**
*
* @since 2021-10-07
+ * @since v0.3.2
*/
public SimpleEntry(K key, V value) {
this.key = key;
@@ -136,6 +137,7 @@ class UnitDatabaseTest {
* @param value value in entry
* @return entry
* @since 2021-10-07
+ * @since v0.3.2
*/
private static <K, V> Map.Entry<K, V> entry(K key, V value) {
return new SimpleEntry<>(key, value);
@@ -149,6 +151,7 @@ class UnitDatabaseTest {
* @param path path of file to load
* @return exceptions returned by file loading
* @since 2021-10-04
+ * @since v0.3.2
*/
private static List<LoadingException> loadDimensionFile(UnitDatabase loadTo,
String path) {
@@ -169,6 +172,7 @@ class UnitDatabaseTest {
* @param path path of file to load
* @return exceptions returned by file loading
* @since 2021-09-22
+ * @since v0.3.2
*/
private static List<LoadingException> loadUnitsFile(UnitDatabase loadTo,
String path) {
@@ -226,6 +230,7 @@ class UnitDatabaseTest {
* function. Simple because the expression parser has its own test.
*
* @since 2021-09-27
+ * @since v0.3.2
*/
@ParameterizedTest
@MethodSource
@@ -254,6 +259,7 @@ class UnitDatabaseTest {
* and {@link UnitDatabase#getLinearUnitValue}.
*
* @since 2021-10-07
+ * @since v0.3.2
*/
@Test
public void testGetUnit() {
@@ -287,6 +293,7 @@ class UnitDatabaseTest {
* throw an {@code IllegalStateException}.
*
* @since 2019-05-03
+ * @since v0.3.0
*/
// @Test
// @Timeout(value = 1, unit = TimeUnit.SECONDS)
@@ -313,6 +320,7 @@ class UnitDatabaseTest {
*
* @param num which file to test
* @since 2021-10-04
+ * @since v0.3.2
*/
@ParameterizedTest
@ValueSource(ints = { 1, 2, 3 })
@@ -335,6 +343,7 @@ class UnitDatabaseTest {
*
* @param num which file to test
* @since 2021-09-27
+ * @since v0.3.2
*/
@ParameterizedTest
@ValueSource(ints = { 1, 2, 3, 4, 5 })
@@ -353,6 +362,7 @@ class UnitDatabaseTest {
* Tests loading a valid dimension-file with some derived dimensions.
*
* @since 2021-10-04
+ * @since v0.3.2
*/
@Test
public void testLoadingValidDimensions() {
@@ -371,6 +381,7 @@ class UnitDatabaseTest {
* Tests loading a valid unitfile with some prefixes and no units.
*
* @since 2021-09-22
+ * @since v0.3.2
*/
@Test
public void testLoadingValidPrefixes() {
@@ -390,6 +401,7 @@ class UnitDatabaseTest {
* Tests loading a valid unitfile with some units and preloaded prefixes
*
* @since 2021-09-22
+ * @since v0.3.2
*/
@Test
public void testLoadingValidUnits() {
@@ -436,6 +448,7 @@ class UnitDatabaseTest {
* the unit map iterator is simple.
*
* @since 2021-10-07
+ * @since v0.3.2
*/
@Test
public void testPrefixedUnitMapIterator() {
@@ -735,6 +748,7 @@ class UnitDatabaseTest {
* Tests the ability to create, read, and delete unit sets.
*
* @since 2025-04-30
+ * @since v1.0.0
*/
@Test
void testUnitSetsInvalid() {
@@ -765,6 +779,7 @@ class UnitDatabaseTest {
* Tests the ability to create, read, and delete unit sets.
*
* @since 2025-04-30
+ * @since v1.0.0
*/
@Test
void testUnitSetsValid() {
diff --git a/src/test/java/sevenUnits/unit/UnitValueTest.java b/src/test/java/sevenUnits/unit/UnitValueTest.java
index 6b80986..6182b20 100644
--- a/src/test/java/sevenUnits/unit/UnitValueTest.java
+++ b/src/test/java/sevenUnits/unit/UnitValueTest.java
@@ -34,6 +34,11 @@ import org.junit.jupiter.params.provider.MethodSource;
import sevenUnits.utils.NameSymbol;
import sevenUnits.utils.UncertainDouble;
+/**
+ * Tests for the UnitValue and LinearUnitValue classes
+ *
+ * @since v1.0.0
+ */
public final class UnitValueTest {
private static Stream<Arguments> testConvertToMultiple() {
return Stream.of(
@@ -160,6 +165,7 @@ public final class UnitValueTest {
* Tests converting an uncertain LinearUnitValue to a string.
*
* @since 2021-11-04
+ * @since v0.3.2
*/
@Test
public void testValueToString1() {
@@ -176,6 +182,7 @@ public final class UnitValueTest {
* Tests converting a certain LinearUnitValue to a string.
*
* @since 2021-11-04
+ * @since v0.3.2
*/
@Test
public void testValueToString2() {
@@ -192,6 +199,7 @@ public final class UnitValueTest {
* Tests converting an unnamed LinearUnitValue to a string.
*
* @since 2021-11-04
+ * @since v0.3.2
*/
@Test
public void testValueToString3() {
@@ -207,6 +215,7 @@ public final class UnitValueTest {
* Tests converting a named UnitValue to a string.
*
* @since 2021-11-04
+ * @since v0.3.2
*/
@Test
public void testValueToString4() {
@@ -219,6 +228,7 @@ public final class UnitValueTest {
* Tests converting an unnamed UnitValue to a string.
*
* @since 2021-11-04
+ * @since v0.3.2
*/
@Test
public void testValueToString5() {
diff --git a/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java b/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java
index 29675de..ea96574 100644
--- a/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java
+++ b/src/test/java/sevenUnits/utils/ConditionalExistenceCollectionsTest.java
@@ -41,6 +41,7 @@ import sevenUnits.utils.ConditionalExistenceCollections.ConditionalExistenceIter
*
* @author Adrien Hopkins
* @since 2019-10-16
+ * @since v0.3.0
*/
class ConditionalExistenceCollectionsTest {
@@ -49,6 +50,7 @@ class ConditionalExistenceCollectionsTest {
*
* @return test iterator
* @since 2019-10-17
+ * @since v0.3.0
*/
ConditionalExistenceIterator<String> getTestIterator() {
final List<String> items = Arrays.asList("aa", "ab", "ba");
@@ -63,6 +65,7 @@ class ConditionalExistenceCollectionsTest {
*
* @return map to be used for test data
* @since 2019-10-16
+ * @since v0.3.0
*/
Map<String, Integer> getTestMap() {
final Map<String, Integer> map = new HashMap<>();
diff --git a/src/test/java/sevenUnits/utils/ExpressionParserTest.java b/src/test/java/sevenUnits/utils/ExpressionParserTest.java
index 463880b..72d3b19 100644
--- a/src/test/java/sevenUnits/utils/ExpressionParserTest.java
+++ b/src/test/java/sevenUnits/utils/ExpressionParserTest.java
@@ -65,6 +65,7 @@ class ExpressionParserTest {
* @return A stream of objects, where each one is an expression and the
* expected result
* @since 2021-09-27
+ * @since v0.3.2
*/
private static final Stream<Arguments> testParseExpressionData() {
return IntStream.range(0, TEST_EXPRESSIONS.size())
diff --git a/src/test/java/sevenUnits/utils/NameSymbolTest.java b/src/test/java/sevenUnits/utils/NameSymbolTest.java
index 55e09c4..3ae2448 100644
--- a/src/test/java/sevenUnits/utils/NameSymbolTest.java
+++ b/src/test/java/sevenUnits/utils/NameSymbolTest.java
@@ -31,6 +31,11 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
+/**
+ * Tests for the {@link NameSymbol} class.
+ *
+ * @since v1.0.0
+ */
class NameSymbolTest {
private static Stream<Arguments> testEqualsHashCode() {
return Stream.of(
diff --git a/src/test/java/sevenUnits/utils/SemanticVersionTest.java b/src/test/java/sevenUnits/utils/SemanticVersionTest.java
index 295ad39..3bef773 100644
--- a/src/test/java/sevenUnits/utils/SemanticVersionTest.java
+++ b/src/test/java/sevenUnits/utils/SemanticVersionTest.java
@@ -35,12 +35,14 @@ import org.junit.jupiter.api.Test;
* Tests for {@link SemanticVersionNumber}
*
* @since 2022-02-19
+ * @since v0.4.0
*/
public final class SemanticVersionTest {
/**
* Test for {@link SemanticVersionNumber#compatible}
*
* @since 2022-02-20
+ * @since v0.4.0
*/
@Test
public void testCompatibility() {
@@ -66,6 +68,7 @@ public final class SemanticVersionTest {
* Tests {@link SemanticVersionNumber#toString} for complex version numbers
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testComplexToString() {
@@ -84,6 +87,7 @@ public final class SemanticVersionTest {
* Tests that complex version can be created and their parts read
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testComplexVersions() {
@@ -116,6 +120,7 @@ public final class SemanticVersionTest {
* Test that semantic version strings can be parsed correctly
*
* @since 2022-02-19
+ * @since v0.4.0
* @see SemanticVersionNumber#fromString
* @see SemanticVersionNumber#isValidVersionString
*/
@@ -267,6 +272,7 @@ public final class SemanticVersionTest {
* Test for {@link SemanticVersionNumber#isStable}
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testIsStable() {
@@ -290,6 +296,7 @@ public final class SemanticVersionTest {
* and some more.
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testOrder() {
@@ -350,6 +357,7 @@ public final class SemanticVersionTest {
* Tests that simple stable versions can be created and their parts read
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testSimpleStableVersions() {
@@ -369,6 +377,7 @@ public final class SemanticVersionTest {
* numbers
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testSimpleToString() {
@@ -383,6 +392,7 @@ public final class SemanticVersionTest {
* Tests that simple unstable versions can be created and their parts read
*
* @since 2022-02-19
+ * @since v0.4.0
*/
@Test
public void testSimpleUnstableVersions() {
diff --git a/src/test/java/sevenUnits/utils/UncertainDoubleTest.java b/src/test/java/sevenUnits/utils/UncertainDoubleTest.java
index fe66e2d..518c818 100644
--- a/src/test/java/sevenUnits/utils/UncertainDoubleTest.java
+++ b/src/test/java/sevenUnits/utils/UncertainDoubleTest.java
@@ -32,6 +32,7 @@ import org.junit.jupiter.api.Test;
*
* @author Adrien Hopkins
* @since 2021-11-29
+ * @since v0.3.2
*/
class UncertainDoubleTest {
/**
@@ -77,6 +78,7 @@ class UncertainDoubleTest {
* Test for {@link UncertainDouble#fromRoundedString}
*
* @since 2022-04-18
+ * @since v0.4.0
*/
@Test
final void testFromRoundedString() {
diff --git a/src/test/java/sevenUnitsGUI/I18nTest.java b/src/test/java/sevenUnitsGUI/I18nTest.java
index 2875db6..1513373 100644
--- a/src/test/java/sevenUnitsGUI/I18nTest.java
+++ b/src/test/java/sevenUnitsGUI/I18nTest.java
@@ -20,12 +20,17 @@ import static org.junit.jupiter.api.Assertions.assertNotNull;
import org.junit.jupiter.api.Test;
+/**
+ * Tests for the internationalization system.
+ *
+ * @since v1.0.0
+ */
class I18nTest {
/**
* Tests that the default locale exists.
*
- * Currently this test fails.
+ * @since v1.0.0
*/
@Test
void testDefaultLocale() {
diff --git a/src/test/java/sevenUnitsGUI/PrefixRepetitionTest.java b/src/test/java/sevenUnitsGUI/PrefixRepetitionTest.java
index ce75cca..50b390b 100644
--- a/src/test/java/sevenUnitsGUI/PrefixRepetitionTest.java
+++ b/src/test/java/sevenUnitsGUI/PrefixRepetitionTest.java
@@ -31,15 +31,15 @@ import sevenUnits.unit.Metric;
/**
* Tests for the default prefix repetition rules.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
class PrefixRepetitionTest {
/**
* Ensures that the complex repetition rule disallows invalid prefix lists.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testInvalidComplexRepetition() {
@@ -58,8 +58,8 @@ class PrefixRepetitionTest {
/**
* Tests the {@code NO_REPETITION} rule.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testNoRepetition() {
@@ -72,8 +72,8 @@ class PrefixRepetitionTest {
/**
* Tests the {@code NO_RESTRICTION} rule.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testNoRestriction() {
@@ -86,8 +86,8 @@ class PrefixRepetitionTest {
/**
* Ensures that the complex repetition rule allows valid prefix lists.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testValidComplexRepetition() {
diff --git a/src/test/java/sevenUnitsGUI/PrefixSearchTest.java b/src/test/java/sevenUnitsGUI/PrefixSearchTest.java
index c7c652b..b605d05 100644
--- a/src/test/java/sevenUnitsGUI/PrefixSearchTest.java
+++ b/src/test/java/sevenUnitsGUI/PrefixSearchTest.java
@@ -36,8 +36,8 @@ import sevenUnits.unit.Metric;
/**
* Tests for {@link PrefixSearchRule}
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
class PrefixSearchTest {
/**
@@ -52,8 +52,8 @@ class PrefixSearchTest {
* {@link sevenUnitsGUI.PrefixSearchRule#apply(java.util.Map.Entry)}, for a
* coherent unit and {@link PrefixSearchRule#COMMON_PREFIXES}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testCoherentPrefixSearch() {
@@ -70,8 +70,8 @@ class PrefixSearchTest {
* Test method for
* {@link sevenUnitsGUI.PrefixSearchRule#equals(java.lang.Object)}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testEquals() {
@@ -85,8 +85,8 @@ class PrefixSearchTest {
/**
* Test method for {@link sevenUnitsGUI.PrefixSearchRule#getPrefixes()}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testGetPrefixes() {
@@ -98,8 +98,8 @@ class PrefixSearchTest {
/**
* Test method for {@link sevenUnitsGUI.PrefixSearchRule#hashCode()}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testHashCode() {
@@ -111,8 +111,8 @@ class PrefixSearchTest {
* Tests prefix searching for a non-coherent unit and
* {@link PrefixSearchRule#COMMON_PREFIXES}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testNonCoherentPrefixSearch() {
@@ -126,8 +126,8 @@ class PrefixSearchTest {
/**
* Tests that {@link PrefixSearchRule#NO_PREFIXES} returns the original unit.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testNoPrefixes() {
@@ -146,8 +146,8 @@ class PrefixSearchTest {
/**
* Test method for {@link sevenUnitsGUI.PrefixSearchRule#toString()}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
final void testToString() {
diff --git a/src/test/java/sevenUnitsGUI/PresenterTest.java b/src/test/java/sevenUnitsGUI/PresenterTest.java
index 20d0c8a..9ac5b84 100644
--- a/src/test/java/sevenUnitsGUI/PresenterTest.java
+++ b/src/test/java/sevenUnitsGUI/PresenterTest.java
@@ -55,8 +55,8 @@ import sevenUnits.utils.UncertainDouble;
*
* @author Adrien Hopkins
*
- * @since v0.4.0
* @since 2022-02-10
+ * @since v0.4.0
*/
public final class PresenterTest {
private static final Path TEST_SETTINGS = Path.of("src", "test", "resources",
@@ -73,8 +73,8 @@ public final class PresenterTest {
/**
* @return rounding rules used by {@link #testRoundingRules}
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
private static Stream<Function<UncertainDouble, String>> getRoundingRules() {
final var SCIENTIFIC_ROUNDING = StandardDisplayRules.uncertaintyBased();
@@ -108,8 +108,8 @@ public final class PresenterTest {
/**
* Test method for {@link Presenter#convertExpressions}
*
- * @since v0.4.0
* @since 2022-02-12
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource
@@ -132,8 +132,8 @@ public final class PresenterTest {
/**
* Test method for {@link Presenter#convertUnits}
*
- * @since v0.4.0
* @since 2022-02-12
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource
@@ -158,8 +158,8 @@ public final class PresenterTest {
/**
* Ensures that the default unitfile can be disabled.
*
- * @since v1.0.0
* @since 2025-02-23
+ * @since v1.0.0
*/
@Test
void testDisableDefault() {
@@ -175,8 +175,8 @@ public final class PresenterTest {
/**
* Tests that duplicate units are successfully removed, if that is asked for
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@Test
void testDuplicateUnits() {
@@ -208,8 +208,8 @@ public final class PresenterTest {
/**
* Tests that one-way conversion correctly filters From and To units
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@Test
void testOneWayConversion() {
@@ -242,8 +242,8 @@ public final class PresenterTest {
/**
* Tests the prefix-viewing functionality.
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@Test
void testPrefixViewing() {
@@ -272,8 +272,8 @@ public final class PresenterTest {
/**
* Tests that rounding rules are used correctly.
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource("getRoundingRules")
@@ -301,8 +301,8 @@ public final class PresenterTest {
* Tests that the Presenter correctly applies search rules.
*
* @param searchRule search rule to test
- * @since v0.4.0
* @since 2022-07-08
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource("getSearchRules")
@@ -335,8 +335,8 @@ public final class PresenterTest {
/**
* Tests that settings can be saved to and loaded from a file.
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@Test
void testSettingsSaving() {
@@ -369,8 +369,8 @@ public final class PresenterTest {
/**
* Ensures the Presenter generates the correct data upon a unit-viewing.
*
- * @since v0.4.0
* @since 2022-04-16
+ * @since v0.4.0
*/
@Test
void testUnitViewing() {
@@ -403,8 +403,8 @@ public final class PresenterTest {
/**
* Test for {@link Presenter#updateView()}
*
- * @since v0.4.0
* @since 2022-02-12
+ * @since v0.4.0
*/
@Test
void testUpdateView() {
diff --git a/src/test/java/sevenUnitsGUI/RoundingTest.java b/src/test/java/sevenUnitsGUI/RoundingTest.java
index 535167c..e6453f2 100644
--- a/src/test/java/sevenUnitsGUI/RoundingTest.java
+++ b/src/test/java/sevenUnitsGUI/RoundingTest.java
@@ -41,8 +41,8 @@ import sevenUnitsGUI.StandardDisplayRules.UncertaintyBased;
/**
* Tests that ensure the rounding rules work as intended.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
class RoundingTest {
// rounding rules to test
@@ -69,8 +69,8 @@ class RoundingTest {
/**
* @return arguments for
* {@link #testFixedDecimalRounding(UncertainDouble, String, String, String)}
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
private static final Stream<Arguments> fixedDecimalRoundingExamples() {
// input, zero decimal string, two decimal string, six decimal string
@@ -83,8 +83,8 @@ class RoundingTest {
/**
* @return arguments for
* {@link #testFixedPrecisionRounding(UncertainDouble, String, String, String)}
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
private static final Stream<Arguments> fixedPrecisionRoundingExamples() {
// input, one sig fig string, three s.f. string, six s.f. string
@@ -97,8 +97,8 @@ class RoundingTest {
/**
* @return arguments for
* {@link #testUncertaintyRounding(UncertainDouble, String)}
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
private static final Stream<Arguments> uncertaintyRoundingExamples() {
// input, uncertainty rounding string
@@ -112,8 +112,8 @@ class RoundingTest {
* Test for {@link FixedDecimals#decimalPlaces()} and
* {@link FixedPrecision#significantFigures()}.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testDataMethods() {
@@ -138,8 +138,8 @@ class RoundingTest {
/**
* Tests that the rounding methods' equals() methods work.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testEquals() {
@@ -174,6 +174,7 @@ class RoundingTest {
* @param twoDecimalString expected string for two decimal places
* @param sixDecimalString expected string for six decimal places
* @since 2022-07-17
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource("fixedDecimalRoundingExamples")
@@ -200,8 +201,8 @@ class RoundingTest {
* @param oneSigFigString expected string for one significant figure
* @param threeSigFigString expected string for three significant figures
* @param twelveSigFigString expected string for twelve significant figures
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource("fixedPrecisionRoundingExamples")
@@ -226,8 +227,8 @@ class RoundingTest {
* Tests that {@link StandardDisplayRules#getStandardRule} gets rounding
* rules as intended.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testGetStandardRule() {
@@ -244,8 +245,8 @@ class RoundingTest {
/**
* Tests that the rounding methods' equals() methods work.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testHashCode() {
@@ -258,8 +259,8 @@ class RoundingTest {
* Tests that the {@code toString()} methods of the three rounding rule
* classes work correctly.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testToString() {
@@ -273,8 +274,8 @@ class RoundingTest {
*
* @param input input number
* @param output expected output string
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@ParameterizedTest
@MethodSource("uncertaintyRoundingExamples")
diff --git a/src/test/java/sevenUnitsGUI/TabbedViewTest.java b/src/test/java/sevenUnitsGUI/TabbedViewTest.java
index 7819452..3716673 100644
--- a/src/test/java/sevenUnitsGUI/TabbedViewTest.java
+++ b/src/test/java/sevenUnitsGUI/TabbedViewTest.java
@@ -26,16 +26,16 @@ import org.junit.jupiter.api.Timeout;
/**
* Test for the TabbedView.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Timeout(value = 10, unit = TimeUnit.SECONDS)
class TabbedViewTest {
/**
* @return a view with all settings set to standard values
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
private static final TabbedView setupView() {
final var view = new TabbedView();
@@ -55,8 +55,8 @@ class TabbedViewTest {
* Simulates an expression conversion operation, and ensures it works
* properly.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testExpressionConversion() {
@@ -76,8 +76,8 @@ class TabbedViewTest {
/**
* Simulates a unit conversion operation, and ensures it works properly.
*
- * @since v0.4.0
* @since 2022-07-17
+ * @since v0.4.0
*/
@Test
void testUnitConversion() {