From dd81f436e80faf3a89bcf8424ee424f2ad152d56 Mon Sep 17 00:00:00 2001 From: Luc Maisonobe Date: Sun, 1 Aug 2010 16:14:11 +0000 Subject: [PATCH] removed duplicate strings git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@981256 13f79535-47bb-0310-9956-ffa450edef68 --- .../MultivariateSummaryStatistics.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java b/src/main/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java index af385219e..766954ea1 100644 --- a/src/main/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java +++ b/src/main/java/org/apache/commons/math/stat/descriptive/MultivariateSummaryStatistics.java @@ -304,17 +304,19 @@ public class MultivariateSummaryStatistics */ @Override public String toString() { + final String separator = ", "; + final String suffix = System.getProperty("line.separator"); StringBuffer outBuffer = new StringBuffer(); - outBuffer.append("MultivariateSummaryStatistics:\n"); - outBuffer.append("n: " + getN() + "\n"); - append(outBuffer, getMin(), "min: ", ", ", "\n"); - append(outBuffer, getMax(), "max: ", ", ", "\n"); - append(outBuffer, getMean(), "mean: ", ", ", "\n"); - append(outBuffer, getGeometricMean(), "geometric mean: ", ", ", "\n"); - append(outBuffer, getSumSq(), "sum of squares: ", ", ", "\n"); - append(outBuffer, getSumLog(), "sum of logarithms: ", ", ", "\n"); - append(outBuffer, getStandardDeviation(), "standard deviation: ", ", ", "\n"); - outBuffer.append("covariance: " + getCovariance().toString() + "\n"); + outBuffer.append("MultivariateSummaryStatistics:" + suffix); + outBuffer.append("n: " + getN() + suffix); + append(outBuffer, getMin(), "min: ", separator, suffix); + append(outBuffer, getMax(), "max: ", separator, suffix); + append(outBuffer, getMean(), "mean: ", separator, suffix); + append(outBuffer, getGeometricMean(), "geometric mean: ", separator, suffix); + append(outBuffer, getSumSq(), "sum of squares: ", separator, suffix); + append(outBuffer, getSumLog(), "sum of logarithms: ", separator, suffix); + append(outBuffer, getStandardDeviation(), "standard deviation: ", separator, suffix); + outBuffer.append("covariance: " + getCovariance().toString() + suffix); return outBuffer.toString(); }