T
- the type of value@NotThreadSafe public class Histogram<T extends Number> extends Object
Modifier and Type | Class and Description |
---|---|
class |
Histogram.Bucket
Represents a bucket in a histogram.
|
class |
Histogram.BucketingStrategy |
class |
Histogram.DefaultBucketingStrategy |
class |
Histogram.ExplicitBucketingStrategy |
class |
Histogram.StandardDeviationBucketingStrategy |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BUCKET_COUNT |
static int |
DEFAULT_SIGNIFICANT_FIGURES |
protected MathOperations<T> |
math |
protected List<T> |
values |
Constructor and Description |
---|
Histogram(MathOperations<T> operations,
List<T> values) |
Histogram(MathOperations<T> operations,
T... values) |
Modifier and Type | Method and Description |
---|---|
protected void |
compute() |
protected static <T> List<T> |
getBucketBoundaries(MathOperations<T> math,
T lowerBound,
T upperBound,
T actualMinimum,
T actualMaximum,
int bucketCount,
int bucketWidthSigFigs) |
int |
getBucketCount()
Return the number of buckets in this histogram.
|
List<Histogram.Bucket> |
getBuckets()
Get the buckets in this histogram.
|
MathOperations<T> |
getMathOperations() |
protected long |
getMaximumCount() |
protected float |
getMaximumPercentage() |
int |
getSignificantFigures() |
Histogram.BucketingStrategy |
getStrategy() |
List<String> |
getTextGraph(int maxBarLength)
Generate a textual (horizontal) bar graph of this histogram.
|
long |
getTotalNumberOfValues()
Return the total number of values that have gone into this histogram.
|
Histogram<T> |
setBucketCount(int count)
Set the number of buckets that this histogram will use.
|
Histogram<T> |
setSignificantFigures(int significantFigures)
Set the number of significant figures used in the calculation of the bucket widths.
|
void |
setStrategy(double median,
double standardDeviation,
int sigma)
Set the histogram to use the standard deviation to determine the bucket sizes.
|
void |
setStrategy(T minimum,
T maximum)
Set the histogram to use the supplied minimum and maximum values to determine the bucket size.
|
void |
setStrategyToDefault()
Set the histogram to use the actual minimum and maximum values to determine the bucket sizes.
|
public static final int DEFAULT_BUCKET_COUNT
public static final int DEFAULT_SIGNIFICANT_FIGURES
protected final MathOperations<T extends Number> math
public Histogram(MathOperations<T> operations, List<T> values)
@SafeVarargs public Histogram(MathOperations<T> operations, T... values)
public Histogram.BucketingStrategy getStrategy()
public MathOperations<T> getMathOperations()
public void setStrategy(double median, double standardDeviation, int sigma)
median
- standardDeviation
- sigma
- public void setStrategy(T minimum, T maximum)
minimum
- maximum
- public void setStrategyToDefault()
public int getSignificantFigures()
public Histogram<T> setSignificantFigures(int significantFigures)
significantFigures
- the number of significant figures for the bucket widthsDEFAULT_SIGNIFICANT_FIGURES
public int getBucketCount()
public Histogram<T> setBucketCount(int count)
count
- the number of bucketsDEFAULT_BUCKET_COUNT
public List<Histogram.Bucket> getBuckets()
protected void compute()
public long getTotalNumberOfValues()
Histogram.Bucket.getPercentageOfValues()
protected float getMaximumPercentage()
protected long getMaximumCount()
public List<String> getTextGraph(int maxBarLength)
maxBarLength
- the maximum bar length, or 0 if the bar length is to represent actual countsprotected static <T> List<T> getBucketBoundaries(MathOperations<T> math, T lowerBound, T upperBound, T actualMinimum, T actualMaximum, int bucketCount, int bucketWidthSigFigs)
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.