You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ps...@apache.org on 2009/11/27 22:05:04 UTC
svn commit: r885013 -
/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java
Author: psteitz
Date: Fri Nov 27 21:05:04 2009
New Revision: 885013
URL: http://svn.apache.org/viewvc?rev=885013&view=rev
Log:
Added toString.
Modified:
commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java
Modified: commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java
URL: http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java?rev=885013&r1=885012&r2=885013&view=diff
==============================================================================
--- commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java (original)
+++ commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java Fri Nov 27 21:05:04 2009
@@ -98,5 +98,20 @@
}
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();
+ }
}