commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r885013 - /commons/proper/math/trunk/src/main/java/org/apache/commons/math/stat/clustering/EuclideanIntegerPoint.java
Date Fri, 27 Nov 2009 21:05:04 GMT
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();
+    }
 
 }



Mime
View raw message