Constructor and Description |
---|
Histo(double l,
double h,
int bins) |
Histo(double l,
double h,
int bins,
boolean autoscale,
boolean autoalloc)
Create a histogram containing real numbers.
|
Histo(int minValue,
int bins) |
Histo(int minValue,
int bins,
int binWidth,
boolean autoalloc)
Create a histogram containing integers.
|
Modifier and Type | Method and Description |
---|---|
void |
add(double d)
Add a value to the histogram.
|
long |
getBin(int bin)
Get the value from a bin.
|
int |
getBinCount()
Get bin count.
|
Optional<Integer> |
getBinIndex(double d)
Look up associated bin.
|
double |
getBinLowerBound(int bin)
Lower bound of a bin.
|
double |
getBinUpperBound(int bin)
Upper bound of a bin.
|
List<String> |
getHistoBody(int rows)
Compose histogram body
|
double |
getLowerBound()
Lower bound of the histogram.
|
List<String> |
getSmallestBinsBlock(int rows)
Compose the list of smallest bins block.
|
List<String> |
getStatBlock()
Compose statistics block.
|
double |
getUpperBound()
Upper bound of the histogram.
|
boolean |
isEmpty()
Check if the histogram is empty.
|
boolean |
isInCurrentBounds(double d)
Check if a bin is associated with the given value.
|
String |
toString() |
String |
toString(int rows,
boolean listSmallBins) |
List<String> |
toStrings() |
List<String> |
toStrings(int rows,
boolean listSmallBins)
Create a String representation.
|
public Histo(int minValue, int bins, int binWidth, boolean autoalloc)
public Histo(int minValue, int bins)
public Histo(double l, double h, int bins, boolean autoscale, boolean autoalloc)
l
- Lowest value to be assigned to the first bin.h
- Highest value to be assigned to the last bin.bins
- Bin count.public Histo(double l, double h, int bins)
public boolean isEmpty()
public void add(double d)
d
- Value to be addedpublic boolean isInCurrentBounds(double d)
d
- ValueUnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public int getBinCount()
public double getLowerBound()
UnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public double getUpperBound()
UnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public double getBinLowerBound(int bin)
bin
- Index of a bin (0-based)UnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public double getBinUpperBound(int bin)
bin
- Index of a bin (0-based)UnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public Optional<Integer> getBinIndex(double d)
d
- A valueUnsupportedOperationException
- when the underlying histogram is auto scaled, in this case the result of
this check would depend on the subsequent value additions.public long getBin(int bin)
bin
- Bin indexpublic List<String> getStatBlock()
Statistics block is a set of lines containing counts, sum, avg, etc
public List<String> getHistoBody(int rows)
Histogram body is the chart area, with axis labels.
rows
- Number of rows in the chart areapublic List<String> getSmallestBinsBlock(int rows)
Smallest bins are the bins, which presented with a minimal height bar and contains fewer than 50% of the values represented by the associated bar.
rows
- Number of rows used to render the histogrampublic List<String> toStrings(int rows, boolean listSmallBins)
rows
- Rows to use for the histogram arealistSmallBins
- List of smallest bins to be printedpublic String toString(int rows, boolean listSmallBins)