|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.sgs.impl.profile.util.LinearHistogram
public class LinearHistogram
A histogram that bins elements based on provided bounds and a step size. This class is useful for viewing a particular range of data and specifying how the distribution is grouped. The lower and upper bounds should be used to filter out all extraneous data points.
| Constructor Summary | |
|---|---|
LinearHistogram(int lBound,
int uBound,
long stepSize)
Creates a linear frequency histogram with the provided lower bound, upper bound and step size. |
|
| Method Summary | |
|---|---|
void |
bin(long value)
Updates the state of the histogram by finding the appropriate bin for the provided value and then incrementing the number of samples seen for that bin. |
void |
clear()
Clears the internal state of the histogram, removing all collected samples. |
int |
size()
Returns the number of samples represented by this histogram. |
String |
toString()
Generates a text representation of this linear frequency histogram. |
String |
toString(String binLabel)
Generates a text representation of this linear frequency histogram similar to toString() but with labels on
bins. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LinearHistogram(int lBound,
int uBound,
long stepSize)
lBound - the lower bound for the histogram; values
strictly less than this will not be includeduBound - the upper bound for the histogram; values
strictly greater than this will not be includedstepSize - the maximum range for each bin between lBound and uBound; if stepSize does not
evenly divide the difference, the last bin will be
truncated in size
IllegalArgumentException - if lBound is not less
than uBound, or if stepSize is not
strictly positive| Method Detail |
|---|
public void bin(long value)
bin in interface Histogramvalue - the value to be aggregatedpublic void clear()
clear in interface Histogrampublic int size()
size in interface Histogrampublic String toString()
[lower-bound] |***
[l.b. + step] |
[l.b. + 2*step] |*
[upper-bound] |****
Bins that have at least one sample will have a bar displayed.
All leading and trailing empty bins are truncated, which may
result in the lower and upper bound bins not being displayed.
The final line will have a newline at the end.
toString in interface HistogramtoString in class Objectpublic String toString(String binLabel)
toString() but with labels on
bins. For example, a bin would appear as:
200ms |*** 400ms |* 600ms |*****
toString in interface HistogrambinLabel - the label to append to each of the bins
|
RedDwarf, Version 0.10.1 2010-03-14 10:56:12 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||