From d7321d2c2063a592fe5acf55063e73bbb769629e Mon Sep 17 00:00:00 2001 From: samskivert Date: Tue, 18 Nov 2008 22:14:42 +0000 Subject: [PATCH] Widening and actually implement Cloneable. git-svn-id: https://samskivert.googlecode.com/svn/trunk@2487 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- src/java/com/samskivert/util/Histogram.java | 25 +++++++++------------ 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/java/com/samskivert/util/Histogram.java b/src/java/com/samskivert/util/Histogram.java index 73b736ce..48573535 100644 --- a/src/java/com/samskivert/util/Histogram.java +++ b/src/java/com/samskivert/util/Histogram.java @@ -23,15 +23,15 @@ package com.samskivert.util; import java.util.Arrays; /** - * Used for tracking a set of values that fall into a discrete range of - * values. + * Used for tracking a set of values that fall into a discrete range of values. */ public class Histogram + implements Cloneable { /** - * Constructs a histogram that will track values with a granularity - * equal to the bucketWidth from minValue to - * minValue + bucketWidth*bucketCount. + * Constructs a histogram that will track values with a granularity equal to the + * bucketWidth from minValue to minValue + + * bucketWidth*bucketCount. */ public Histogram (int minValue, int bucketWidth, int bucketCount) { @@ -73,11 +73,10 @@ public class Histogram } /** - * Returns the array containing the bucket values. The zeroth element - * contains the count of all values less than minValue, - * the subsequent bucketCount elements contain the count - * of values falling into those buckets and the last element contains - * values greater than or equal to maxValue. + * Returns the array containing the bucket values. The zeroth element contains the count of all + * values less than minValue, the subsequent bucketCount elements + * contain the count of values falling into those buckets and the last element contains values + * greater than or equal to maxValue. */ public int[] getBuckets () { @@ -85,8 +84,7 @@ public class Histogram } /** - * Generates a terse summary of the count and contents of the values - * in this histogram. + * Generates a terse summary of the count and contents of the values in this histogram. */ public String summarize () { @@ -116,8 +114,7 @@ public class Histogram @Override // from Object public String toString () { - return "[min=" + _minValue + ", max=" + _maxValue + - ", bwidth=" + _bucketWidth + + return "[min=" + _minValue + ", max=" + _maxValue + ", bwidth=" + _bucketWidth + ", buckets=" + StringUtil.toString(_buckets) + "]"; }