You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2012/03/03 03:51:27 UTC

svn commit: r1296566 - in /commons/proper/math/trunk/src: main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java

Author: erans
Date: Sat Mar  3 02:51:26 2012
New Revision: 1296566

URL: http://svn.apache.org/viewvc?rev=1296566&view=rev
Log:
Variable visibility: "protected" -> "private". Had to delete a few trivial
tests that accessed the fields.

Modified:
    commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java
    commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java

Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java?rev=1296566&r1=1296565&r2=1296566&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math3/stat/descriptive/SummaryStatistics.java Sat Mar  3 02:51:26 2012
@@ -64,34 +64,34 @@ public class SummaryStatistics implement
     private static final long serialVersionUID = -2021321786743555871L;
 
     /** count of values that have been added */
-    protected long n = 0;
+    private long n = 0;
 
     /** SecondMoment is used to compute the mean and variance */
-    protected SecondMoment secondMoment = new SecondMoment();
+    private SecondMoment secondMoment = new SecondMoment();
 
     /** sum of values that have been added */
-    protected Sum sum = new Sum();
+    private Sum sum = new Sum();
 
     /** sum of the square of each value that has been added */
-    protected SumOfSquares sumsq = new SumOfSquares();
+    private SumOfSquares sumsq = new SumOfSquares();
 
     /** min of values that have been added */
-    protected Min min = new Min();
+    private Min min = new Min();
 
     /** max of values that have been added */
-    protected Max max = new Max();
+    private Max max = new Max();
 
     /** sumLog of values that have been added */
-    protected SumOfLogs sumLog = new SumOfLogs();
+    private SumOfLogs sumLog = new SumOfLogs();
 
     /** geoMean of values that have been added */
-    protected GeometricMean geoMean = new GeometricMean(sumLog);
+    private GeometricMean geoMean = new GeometricMean(sumLog);
 
     /** mean of values that have been added */
-    protected Mean mean = new Mean(secondMoment);
+    private Mean mean = new Mean(secondMoment);
 
     /** variance of values that have been added */
-    protected Variance variance = new Variance(secondMoment);
+    private Variance variance = new Variance(secondMoment);
 
     /** Sum statistic implementation - can be reset by setter. */
     private StorelessUnivariateStatistic sumImpl = sum;

Modified: commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java?rev=1296566&r1=1296565&r2=1296566&view=diff
==============================================================================
--- commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java (original)
+++ commons/proper/math/trunk/src/test/java/org/apache/commons/math3/stat/descriptive/SummaryStatisticsTest.java Sat Mar  3 02:51:26 2012
@@ -238,14 +238,6 @@ public class SummaryStatisticsTest {
         SummaryStatistics v = new SummaryStatistics(u);
         Assert.assertEquals(u, v);
         Assert.assertEquals(v, u);
-        Assert.assertTrue(v.geoMean == v.getGeoMeanImpl());
-        Assert.assertTrue(v.mean == v.getMeanImpl());
-        Assert.assertTrue(v.min == v.getMinImpl());
-        Assert.assertTrue(v.max == v.getMaxImpl());
-        Assert.assertTrue(v.sum == v.getSumImpl());
-        Assert.assertTrue(v.sumsq == v.getSumsqImpl());
-        Assert.assertTrue(v.sumLog == v.getSumLogImpl());
-        Assert.assertTrue(v.variance == v.getVarianceImpl());
 
         // Make sure both behave the same with additional values added
         u.addValue(7d);
@@ -263,7 +255,6 @@ public class SummaryStatisticsTest {
         u.clear();
         u.setSumImpl(new Sum());
         SummaryStatistics.copy(u,v);
-        Assert.assertEquals(u.sum, v.sum);
         Assert.assertEquals(u.getSumImpl(), v.getSumImpl());
 
     }