From 75d4db00e1b1d4ef53ca4d0c5ac247ec92cdb2d9 Mon Sep 17 00:00:00 2001 From: Gilles Sadowski Date: Thu, 26 Jun 2014 13:05:24 +0000 Subject: [PATCH] Typo. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1605776 13f79535-47bb-0310-9956-ffa450edef68 --- .../math3/stat/descriptive/rank/Median.java | 2 +- .../math3/stat/descriptive/rank/Percentile.java | 2 +- .../math3/stat/descriptive/rank/MedianTest.java | 2 +- .../stat/descriptive/rank/PercentileTest.java | 16 ++++++++-------- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Median.java b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Median.java index f0423477e..2a64fba5a 100644 --- a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Median.java +++ b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Median.java @@ -80,7 +80,7 @@ public class Median extends Percentile implements Serializable { /** {@inheritDoc} */ @Override - public Median withEstimationtype(final EstimationType newEstimationType) { + public Median withEstimationType(final EstimationType newEstimationType) { return new Median(newEstimationType, getNaNStrategy(), getPivotingStrategy()); } diff --git a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Percentile.java b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Percentile.java index c963fad77..d6a4209e5 100644 --- a/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Percentile.java +++ b/src/main/java/org/apache/commons/math3/stat/descriptive/rank/Percentile.java @@ -590,7 +590,7 @@ public class Percentile extends AbstractUnivariateStatistic implements Serializa * @return a new instance, with changed pivoting strategy * @throws NullArgumentException when pivotingStrategy is null */ - public Percentile withEstimationtype(final EstimationType newEstimationType) { + public Percentile withEstimationType(final EstimationType newEstimationType) { return new Percentile(quantile, newEstimationType, nanStrategy, pivotingStrategy); } diff --git a/src/test/java/org/apache/commons/math3/stat/descriptive/rank/MedianTest.java b/src/test/java/org/apache/commons/math3/stat/descriptive/rank/MedianTest.java index e02a3ac16..cbe7a7ac9 100644 --- a/src/test/java/org/apache/commons/math3/stat/descriptive/rank/MedianTest.java +++ b/src/test/java/org/apache/commons/math3/stat/descriptive/rank/MedianTest.java @@ -60,7 +60,7 @@ public class MedianTest extends UnivariateStatisticAbstractTest{ private Median getTestMedian(EstimationType type) { NaNStrategy strategy = (type == LEGACY) ? NaNStrategy.FIXED : NaNStrategy.REMOVED; - return new Median().withEstimationtype(type).withNaNStrategy(strategy); + return new Median().withEstimationType(type).withNaNStrategy(strategy); } /** diff --git a/src/test/java/org/apache/commons/math3/stat/descriptive/rank/PercentileTest.java b/src/test/java/org/apache/commons/math3/stat/descriptive/rank/PercentileTest.java index 292ade205..f7a451540 100644 --- a/src/test/java/org/apache/commons/math3/stat/descriptive/rank/PercentileTest.java +++ b/src/test/java/org/apache/commons/math3/stat/descriptive/rank/PercentileTest.java @@ -90,7 +90,7 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ @Override public Percentile getUnivariateStatistic() { return new Percentile(quantile). - withEstimationtype(type). + withEstimationType(type). withNaNStrategy(nanStrategy). withPivotingStrategy(pivotingStrategy); } @@ -776,10 +776,10 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ @Test public void testNanStrategySpecific() { double[] specialValues = new double[] { 0d, 1d, 2d, 3d, 4d, Double.NaN }; - Assert.assertTrue(Double.isNaN(new Percentile(50d).withEstimationtype(Percentile.EstimationType.LEGACY).withNaNStrategy(NaNStrategy.MAXIMAL).evaluate(specialValues, 3, 3))); - Assert.assertEquals(2d,new Percentile(50d).withEstimationtype(Percentile.EstimationType.R_1).withNaNStrategy(NaNStrategy.REMOVED).evaluate(specialValues),0d); - Assert.assertEquals(Double.NaN,new Percentile(50d).withEstimationtype(Percentile.EstimationType.R_5).withNaNStrategy(NaNStrategy.REMOVED).evaluate(new double[] {Double.NaN,Double.NaN,Double.NaN}),0d); - Assert.assertEquals(50d,new Percentile(50d).withEstimationtype(Percentile.EstimationType.R_7).withNaNStrategy(NaNStrategy.MINIMAL).evaluate(new double[] {50d,50d,50d},1,2),0d); + Assert.assertTrue(Double.isNaN(new Percentile(50d).withEstimationType(Percentile.EstimationType.LEGACY).withNaNStrategy(NaNStrategy.MAXIMAL).evaluate(specialValues, 3, 3))); + Assert.assertEquals(2d,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_1).withNaNStrategy(NaNStrategy.REMOVED).evaluate(specialValues),0d); + Assert.assertEquals(Double.NaN,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_5).withNaNStrategy(NaNStrategy.REMOVED).evaluate(new double[] {Double.NaN,Double.NaN,Double.NaN}),0d); + Assert.assertEquals(50d,new Percentile(50d).withEstimationType(Percentile.EstimationType.R_7).withNaNStrategy(NaNStrategy.MINIMAL).evaluate(new double[] {50d,50d,50d},1,2),0d); } // Some NaNStrategy specific testing @@ -788,7 +788,7 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ double[] specialValues = new double[] { 0d, 1d, 2d, 3d, 4d, Double.NaN }; new Percentile(50d). - withEstimationtype(Percentile.EstimationType.R_9). + withEstimationType(Percentile.EstimationType.R_9). withNaNStrategy(NaNStrategy.FAILED). evaluate(specialValues, 3, 3); } @@ -798,7 +798,7 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ double[] specialValues = new double[] { 0d, 1d, 2d, 3d, 4d, Double.NaN }; try { - new Percentile(50d).withEstimationtype(Percentile.EstimationType.LEGACY).withNaNStrategy(null); + new Percentile(50d).withEstimationType(Percentile.EstimationType.LEGACY).withNaNStrategy(null); Assert.fail("Expecting NullArgumentArgumentException " + "for null Nan Strategy"); } catch (NullArgumentException ex) { @@ -848,7 +848,7 @@ public class PercentileTest extends UnivariateStatisticAbstractTest{ Percentile.EstimationType e = (Percentile.EstimationType) o[0]; double expected = (Double) o[1]; try { - double result = new Percentile(p).withEstimationtype(e).withNaNStrategy(nanStrategy).evaluate(data); + double result = new Percentile(p).withEstimationType(e).withNaNStrategy(nanStrategy).evaluate(data); Assert.assertEquals("expected[" + e + "] = " + expected + " but was = " + result, expected, result, tolerance); }catch(Exception ex) {