com.ibm.dtfj.analyzer.util
Class Histogram

java.lang.Object
  extended by com.ibm.dtfj.analyzer.util.Histogram

public class Histogram
extends java.lang.Object

A class to simplify the creation of histogram plots such as a plot of object size etc.


Constructor Summary
Histogram(int size, int num)
          Build a Histogram with the given bucket size and number with data values starting at zero.
Histogram(int size, int num, int start)
          Build a Histogram with the given bucket size, number and starting offset.
 
Method Summary
 int getValue(int index)
          Get the contents of the given bucket.
 void printReport(java.lang.String title, IAnalysisReport report)
          Output the histogram in the given report
 void recordValue(int value)
          Record the given value in the histogram
 java.lang.String toString()
          (non-Javadoc)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Histogram

public Histogram(int size,
                 int num,
                 int start)
Build a Histogram with the given bucket size, number and starting offset. Values below that offset (which can be negative) are recorded in the zeroth bucket.

Parameters:
size - the size of the buckets
num - the number of buckets to be stored
start - the starting value to be recorded in the histogam

Histogram

public Histogram(int size,
                 int num)
Build a Histogram with the given bucket size and number with data values starting at zero.

Parameters:
size - the size of the buckets
num - the number of buckets to be stored
Method Detail

recordValue

public void recordValue(int value)
Record the given value in the histogram

Parameters:
value - the value to be recorded

getValue

public int getValue(int index)
Get the contents of the given bucket. Note that bucket 0 is the total of values below the start value and bucket 'num' is the total of values above the start plus the number*size of the buckets.

Parameters:
index - the bucket number
Returns:
the bucket content

printReport

public void printReport(java.lang.String title,
                        IAnalysisReport report)
Output the histogram in the given report

Parameters:
title - a title for the histogram
report - the report

toString

public java.lang.String toString()
(non-Javadoc)

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


© Copyright IBM Corp. 2007, 2008 All Rights Reserved. US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.