diff --git a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Max.java b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Max.java
index 92181c45b..a87c48f9a 100644
--- a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Max.java
+++ b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Max.java
@@ -18,6 +18,7 @@ package org.apache.commons.math3.stat.descriptive.rank;
import java.io.Serializable;
+import org.apache.commons.math3.exception.MathIllegalArgumentException;
import org.apache.commons.math3.exception.NullArgumentException;
import org.apache.commons.math3.stat.descriptive.AbstractStorelessUnivariateStatistic;
import org.apache.commons.math3.util.MathUtils;
@@ -63,8 +64,9 @@ public class Max extends AbstractStorelessUnivariateStatistic implements Seriali
* to the {@code original}
*
* @param original the {@code Max} instance to copy
+ * @throws NullArgumentException if original is null
*/
- public Max(Max original) {
+ public Max(Max original) throws NullArgumentException {
copy(original, this);
}
@@ -108,7 +110,7 @@ public class Max extends AbstractStorelessUnivariateStatistic implements Seriali
* the input array, or Double.NaN
if the designated subarray
* is empty.
*
- * Throws IllegalArgumentException
if the array is null or
+ * Throws MathIllegalArgumentException
if the array is null or
* the array index parameters are not valid.
*
Double.NaN
if the designated subarray
* is empty.
*
- * Throws IllegalArgumentException
if the array is null or
+ * Throws MathIllegalArgumentException
if the array is null or
* the array index parameters are not valid.
*
* The stored array is the one which was set by previous calls to + * {@link #setData(double[])} *
* @param p the percentile value to compute * @return the value of the statistic applied to the stored data + * @throws MathIllegalArgumentException if p is not a valid quantile value + * (p must be greater than 0 and less than or equal to 100) */ - public double evaluate(final double p) { + public double evaluate(final double p) throws MathIllegalArgumentException { return evaluate(getDataRef(), p); } @@ -175,7 +182,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa *0
* p
) values[0]
* if values
has length 1
IllegalArgumentException
if values
+ * MathIllegalArgumentException
if values
* is null or p is not a valid quantile value (p must be greater than 0
* and less than or equal to 100) values
is null
+ * @throws MathIllegalArgumentException if values
is null
* or p is invalid
*/
- public double evaluate(final double[] values, final double p) {
+ public double evaluate(final double[] values, final double p)
+ throws MathIllegalArgumentException {
test(values, 0, 0);
return evaluate(values, 0, values.length, p);
}
@@ -203,9 +211,8 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa
* Double.NaN
if length = 0
quantile
)
* values[begin]
if length = 1
IllegalArgumentException
if values
- * is null, or start
or length
- * is invalidMathIllegalArgumentException
if values
+ * is null, or start
or length
is invalid* See {@link Percentile} for a description of the percentile estimation @@ -215,11 +222,12 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * @param start index of the first array element to include * @param length the number of elements to include * @return the percentile value - * @throws IllegalArgumentException if the parameters are not valid + * @throws MathIllegalArgumentException if the parameters are not valid * */ @Override - public double evaluate( final double[] values, final int start, final int length) { + public double evaluate(final double[] values, final int start, final int length) + throws MathIllegalArgumentException { return evaluate(values, start, length, quantile); } @@ -236,7 +244,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa *
Double.NaN
if length = 0
p
) values[begin]
* if length = 1
IllegalArgumentException
if values
+ * MathIllegalArgumentException
if values
* is null , begin
or length
is invalid, or
* p
is not a valid quantile value (p must be greater than 0
* and less than or equal to 100)