This is an automated email from the ASF dual-hosted git repository.

aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-statistics.git

commit 7b6642cbb1c2e2f5df8f012137e4782084c9019e
Author: Alex Herbert <[email protected]>
AuthorDate: Sat Sep 16 13:34:14 2023 +0100

    Javadoc updates
    
    * Change <code> to {@code }
    
    * Replace some @code sections with @link to javadoc
---
 .../statistics/descriptive/FirstMoment.java        | 17 +++++++-------
 .../apache/commons/statistics/descriptive/Max.java | 19 +++++++--------
 .../commons/statistics/descriptive/Mean.java       | 19 +++++++--------
 .../apache/commons/statistics/descriptive/Min.java | 19 +++++++--------
 .../apache/commons/statistics/descriptive/Sum.java | 15 ++++++------
 .../descriptive/SumOfSquaredDeviations.java        | 12 ++++++----
 .../commons/statistics/descriptive/Variance.java   | 27 +++++++++++-----------
 7 files changed, 68 insertions(+), 60 deletions(-)

diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/FirstMoment.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/FirstMoment.java
index bd24544..d9ee25e 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/FirstMoment.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/FirstMoment.java
@@ -26,22 +26,23 @@ import java.util.function.DoubleConsumer;
  * <p> To limit numeric errors, the value of the statistic is computed using 
the
  * following recursive updating algorithm:
  * <ol>
- * <li>Initialize <code>m = </code> the first value</li>
+ * <li>Initialize {@code m = } the first value</li>
  * <li>For each additional value, update using <br>
- *   <code>m = m + (new value - m) / (number of observations)</code></li>
+ *   {@code m = m + (new value - m) / (number of observations)}</li>
  * </ol>
  *
- * <p>Returns <code>Double.NaN</code> if the dataset is empty. Note that
- * <code>NaN</code> may also be returned if the input includes NaN and / or 
infinite
- *  values of opposite sign.
+ * <p>Returns {@code NaN} if the dataset is empty. Note that
+ * {@code NaN} may also be returned if the input includes {@code NaN} and / or 
infinite
+ * values of opposite sign.
  *
  * <p><strong>Note that this implementation is not synchronized.</strong> If
  * multiple threads access an instance of this class concurrently, and at least
  * one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -114,7 +115,7 @@ class FirstMoment implements DoubleConsumer {
     /**
      * Gets the first moment of all input values.
      *
-     * <p>When no values have been added, the result is <code>NaN</code>.
+     * <p>When no values have been added, the result is {@code NaN}.
      *
      * @return {@code First moment} of all values seen so far, if it is finite.
      * <p> {@code Infinity}, if infinities of the same sign have been 
encountered.
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Max.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Max.java
index e74a629..1b8a8eb 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Max.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Max.java
@@ -19,9 +19,9 @@ package org.apache.commons.statistics.descriptive;
 /**
  * Returns the maximum of the available values.
  *
- * <p>The result is <code>NaN</code> if any of the values is <code>NaN</code>.
+ * <p>The result is {@code NaN} if any of the values is {@code NaN}.
  *
- * <p>The result is <code>NEGATIVE_INFINITY</code> if no values are added.
+ * <p>The result is {@link Double#NEGATIVE_INFINITY negative infinity} if no 
values are added.
  *
  * <p>This class is designed to work with (though does not require)
  * {@linkplain java.util.stream streams}.
@@ -31,8 +31,9 @@ package org.apache.commons.statistics.descriptive;
  * and at least one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -52,9 +53,9 @@ public abstract class Max implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Creates a {@code Max} implementation which does not store the input 
value(s) it consumes.
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN}.
      *
-     * <p>The result is {@link Double#NEGATIVE_INFINITY NEGATIVE_INFINITY}
+     * <p>The result is {@link Double#NEGATIVE_INFINITY negative infinity}
      * if no values have been added.
      *
      * @return {@code Max} implementation.
@@ -66,10 +67,10 @@ public abstract class Max implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Returns a {@code Max} instance that has the maximum of all input 
value(s).
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN}.
      *
      * <p>When the input is an empty array, the result is
-     * {@link Double#NEGATIVE_INFINITY NEGATIVE_INFINITY}.
+     * {@link Double#NEGATIVE_INFINITY negative infinity}.
      *
      * @param values Values.
      * @return {@code Max} instance.
@@ -89,7 +90,7 @@ public abstract class Max implements DoubleStatistic, 
DoubleStatisticAccumulator
      * Gets the maximum of all input values.
      *
      * <p>When no values have been added, the result is
-     * {@link Double#NEGATIVE_INFINITY NEGATIVE_INFINITY}.
+     * {@link Double#NEGATIVE_INFINITY negative infinity}.
      *
      * @return {@code Maximum} of all values seen so far.
      */
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Mean.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Mean.java
index 3bda901..ddb590b 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Mean.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Mean.java
@@ -20,9 +20,9 @@ package org.apache.commons.statistics.descriptive;
  * Computes the arithmetic mean of a set of values. Uses the following 
recursive
  * updating algorithm:
  * <ol>
- * <li>Initialize <code>m = </code> the first value</li>
+ * <li>Initialize {@code m = } the first value</li>
  * <li>For each additional value, update using <br>
- *   <code>m = m + (new value - m) / (number of observations)</code></li>
+ *   {@code m = m + (new value - m) / (number of observations)}</li>
  * </ol>
  *
  * <p>If {@link #of(double...)} is used to compute the mean of a variable 
number
@@ -33,8 +33,8 @@ package org.apache.commons.statistics.descriptive;
  * Sample Means and Variances," Robert F. Ling, Journal of the American
  * Statistical Association, Vol. 69, No. 348 (Dec., 1974), pp. 859-866.
  *
- * <p>Returns <code>NaN</code> if the dataset is empty. Note that
- * <code>NaN</code> may also be returned if the input includes 
<code>NaN</code> and / or infinite
+ * <p>Returns {@code NaN} if the dataset is empty. Note that
+ * {@code NaN} may also be returned if the input includes {@code NaN} and / or 
infinite
  * values of opposite sign.
  *
  * <p>This class is designed to work with (though does not require)
@@ -45,8 +45,9 @@ package org.apache.commons.statistics.descriptive;
  * one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -66,7 +67,7 @@ public abstract class Mean implements DoubleStatistic, 
DoubleStatisticAccumulato
     /**
      * Creates a {@code Mean} implementation which does not store the input 
value(s) it consumes.
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code> or
+     * <p>The result is {@code NaN} if any of the values is {@code NaN} or
      * if no values have been added.
      *
      * @return {@code Mean} implementation.
@@ -76,7 +77,7 @@ public abstract class Mean implements DoubleStatistic, 
DoubleStatisticAccumulato
     }
 
     /**
-     * Returns a {@code Mean} instance that has the arithmetic mean of all 
input values, or <code>NaN</code>
+     * Returns a {@code Mean} instance that has the arithmetic mean of all 
input values, or {@code NaN}
      * if the input array is empty.
      *
      * <p>Note: {@code Mean} computed using {@link Mean#accept Mean.accept()} 
may be different
@@ -113,7 +114,7 @@ public abstract class Mean implements DoubleStatistic, 
DoubleStatisticAccumulato
     /**
      * Gets the mean of all input values.
      *
-     * <p>When no values have been added, the result is <code>NaN</code>.
+     * <p>When no values have been added, the result is {@code NaN}.
      *
      * @return {@code Mean} of all values seen so far.
      */
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Min.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Min.java
index b6f4555..bc55aef 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Min.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Min.java
@@ -19,9 +19,9 @@ package org.apache.commons.statistics.descriptive;
 /**
  * Returns the minimum of the available values.
  *
- * <p>The result is <code>NaN</code> if any of the values is <code>NaN</code>.
+ * <p>The result is {@code NaN} if any of the values is {@code NaN}.
  *
- * <p>The result is <code>POSITIVE_INFINITY</code> if no values are added.
+ * <p>The result is {@link Double#POSITIVE_INFINITY positive infinity} if no 
values are added.
  *
  * <p>This class is designed to work with (though does not require)
  * {@linkplain java.util.stream streams}.
@@ -31,8 +31,9 @@ package org.apache.commons.statistics.descriptive;
  * and at least one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -52,9 +53,9 @@ public abstract class Min implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Creates a {@code Min} implementation which does not store the input 
value(s) it consumes.
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN}.
      *
-     * <p>The result is {@link Double#POSITIVE_INFINITY POSITIVE_INFINITY}
+     * <p>The result is {@link Double#POSITIVE_INFINITY positive infinity}
      * if no values have been added.
      *
      * @return {@code Min} implementation.
@@ -66,10 +67,10 @@ public abstract class Min implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Returns a {@code Min} instance that has the minimum of all input 
value(s).
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN}.
      *
      * <p>When the input is an empty array, the result is
-     * {@link Double#POSITIVE_INFINITY POSITIVE_INFINITY}.
+     * {@link Double#POSITIVE_INFINITY positive infinity}.
      *
      * @param values Values.
      * @return {@code Min} instance.
@@ -89,7 +90,7 @@ public abstract class Min implements DoubleStatistic, 
DoubleStatisticAccumulator
      * Gets the minimum of all input values.
      *
      * <p>When no values have been added, the result is
-     * {@link Double#POSITIVE_INFINITY POSITIVE_INFINITY}.
+     * {@link Double#POSITIVE_INFINITY positive infinity}.
      *
      * @return {@code Minimum} of all values seen so far.
      */
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Sum.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Sum.java
index 62a41c7..a1f2ad1 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Sum.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Sum.java
@@ -19,7 +19,7 @@ package org.apache.commons.statistics.descriptive;
 /**
  * Returns the sum of the available values.
  *
- * <p>The result is <code>NaN</code> if any of the values is <code>NaN</code>.
+ * <p>The result is {@code NaN} if any of the values is {@code NaN}.
  *
  * <p>The result is zero if no values are added.
  *
@@ -31,8 +31,9 @@ package org.apache.commons.statistics.descriptive;
  * and at least one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -52,8 +53,8 @@ public abstract class Sum implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Creates a {@code Sum} implementation which does not store the input 
value(s) it consumes.
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code> or the sum
-     * at any point is a <code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN} or the 
sum
+     * at any point is a {@code NaN}.
      *
      * <p>The result is zero if no values have been added.
      *
@@ -68,8 +69,8 @@ public abstract class Sum implements DoubleStatistic, 
DoubleStatisticAccumulator
     /**
      * Returns a {@code Sum} instance that has the sum of all input value(s).
      *
-     * <p>The result is <code>NaN</code> if any of the values is 
<code>NaN</code>
-     * or the sum at any point is a <code>NaN</code>.
+     * <p>The result is {@code NaN} if any of the values is {@code NaN}
+     * or the sum at any point is a {@code NaN}.
      *
      * <p>When the input is an empty array, the result is zero.
      *
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfSquaredDeviations.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfSquaredDeviations.java
index 9c24d29..895b25f 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfSquaredDeviations.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/SumOfSquaredDeviations.java
@@ -39,11 +39,13 @@ package org.apache.commons.statistics.descriptive;
  * one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept} and
- * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} as 
<code>accumulator</code> and
- * <code>combiner</code> functions of {@link java.util.stream.Collector 
Collector} on a parallel stream, because the
- * parallel implementation of {@link java.util.stream.Stream#collect 
Stream.collect()} provides the necessary
- * partitioning, isolation, and merging of results for safe and efficient 
parallel execution.
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
+ * {@link java.util.stream.Collector Collector} on a parallel stream,
+ * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
+ * provides the necessary partitioning, isolation, and merging of results for
+ * safe and efficient parallel execution.
  */
 class SumOfSquaredDeviations extends FirstMoment {
     /** Sum of squared deviations of the values that have been added. */
diff --git 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Variance.java
 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Variance.java
index df8dbe7..731cde7 100644
--- 
a/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Variance.java
+++ 
b/commons-statistics-descriptive/src/main/java/org/apache/commons/statistics/descriptive/Variance.java
@@ -43,10 +43,10 @@ package org.apache.commons.statistics.descriptive;
  * should only be used when the full array of values is not available.
  *
  * <p>
- * Returns <code>Double.NaN</code> if no data values have been added and
- * returns <code>0</code> if there is just one finite value in the data set.
- * Note that <code>Double.NaN</code> may also be returned if the input includes
- * <code>Double.NaN</code> and / or infinite values.
+ * Returns {@code NaN} if no data values have been added and
+ * returns {@code 0} if there is just one finite value in the data set.
+ * Note that {@code NaN} may also be returned if the input includes
+ * {@code NaN} and / or infinite values.
  *
  * <p>This class is designed to work with (though does not require)
  * {@linkplain java.util.stream streams}.
@@ -56,8 +56,9 @@ package org.apache.commons.statistics.descriptive;
  * one of the threads invokes the {@link 
java.util.function.DoubleConsumer#accept(double) accept} or
  * {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine} method, 
it must be synchronized externally.
  *
- * <p>However, it is safe to use <code>accept()</code> and 
<code>combine()</code>
- * as <code>accumulator</code> and <code>combiner</code> functions of
+ * <p>However, it is safe to use {@link 
java.util.function.DoubleConsumer#accept(double) accept}
+ * and {@link DoubleStatisticAccumulator#combine(DoubleStatistic) combine}
+ * as {@code accumulator} and {@code combiner} functions of
  * {@link java.util.stream.Collector Collector} on a parallel stream,
  * because the parallel implementation of {@link 
java.util.stream.Stream#collect Stream.collect()}
  * provides the necessary partitioning, isolation, and merging of results for
@@ -77,10 +78,10 @@ public abstract class Variance implements DoubleStatistic, 
DoubleStatisticAccumu
     /**
      * Creates a {@code Variance} implementation which does not store the 
input value(s) it consumes.
      *
-     * <p>The result is <code>NaN</code> if:
+     * <p>The result is {@code NaN} if:
      * <ul>
      *     <li>no values have been added,</li>
-     *     <li>any of the values is <code>NaN</code>, or</li>
+     *     <li>any of the values is {@code NaN}, or</li>
      *     <li>an infinite value of either sign is encountered</li>
      * </ul>
      *
@@ -91,11 +92,11 @@ public abstract class Variance implements DoubleStatistic, 
DoubleStatisticAccumu
     }
 
     /**
-     * Returns a {@code Variance} instance that has the variance of all input 
values, or <code>NaN</code>
+     * Returns a {@code Variance} instance that has the variance of all input 
values, or {@code NaN}
      * if:
      * <ul>
      *     <li>the input array is empty,</li>
-     *     <li>any of the values is <code>NaN</code>,</li>
+     *     <li>any of the values is {@code NaN},</li>
      *     <li>an infinite value of either sign is encountered, or</li>
      *     <li>the sum of the squared deviations from the mean is infinite</li>
      * </ul>
@@ -145,14 +146,14 @@ public abstract class Variance implements 
DoubleStatistic, DoubleStatisticAccumu
     /**
      * Gets the variance of all input values.
      *
-     * <p>The result is <code>NaN</code> if :
+     * <p>The result is {@code NaN} if :
      * <ul>
      *     <li>the input array is empty,</li>
-     *     <li>any of the values is <code>NaN</code>, or</li>
+     *     <li>any of the values is {@code NaN}, or</li>
      *     <li>an infinite value of either sign is encountered</li>
      * </ul>
      *
-     * <p>The result is <code>0</code> if there is just one finite value in 
the data set.
+     * <p>The result is {@code 0} if there is just one finite value in the 
data set.
      *
      * @return {@code Variance} of all values seen so far.
      */

Reply via email to