Added toString.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@885013 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Phil Steitz 2009-11-27 21:05:04 +00:00
parent cab28ac044
commit 9e6576e7cd
1 changed files with 15 additions and 0 deletions

View File

@ -98,5 +98,20 @@ public class EuclideanIntegerPoint implements Clusterable<EuclideanIntegerPoint>
}
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();
}
}