summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/utils
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 /src/main/java/sevenUnits/utils
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.
Diffstat (limited to 'src/main/java/sevenUnits/utils')
-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
8 files changed, 100 insertions, 25 deletions
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;