From 9e6576e7cd4ad17185c5102fd3c6f9f9a6941ed4 Mon Sep 17 00:00:00 2001 From: Phil Steitz Date: Fri, 27 Nov 2009 21:05:04 +0000 Subject: [PATCH] Added toString. git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@885013 13f79535-47bb-0310-9956-ffa450edef68 --- .../stat/clustering/EuclideanIntegerPoint.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java b/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java index 49dd71cf0..43b5474f7 100644 --- a/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java +++ b/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java @@ -98,5 +98,20 @@ public class EuclideanIntegerPoint implements Clusterable } return hashCode; } + + /** {@inheritDoc} */ + @Override + public String toString() { + final StringBuffer buff = new StringBuffer("("); + final int[] coordinates = getPoint(); + for (int i = 0; i < coordinates.length; i++) { + buff.append(coordinates[i]); + if (i < coordinates.length - 1) { + buff.append(","); + } + } + buff.append(")"); + return buff.toString(); + } }