|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaitools.numeric.Histogram<T>
T - the value typepublic class Histogram<T extends Number & Comparable>
A simple numeric histogram class that uses the Range class to define bins. New bins can be defined even after data had already been added to allow a histogram to adapt to the input data, however the new bins must not overlap with existing bins.
| Field Summary | |
|---|---|
static int |
NO_BIN
Constant indicating that a value does not fall in any bin |
| Constructor Summary | |
|---|---|
Histogram()
Creates a new histogram. |
|
| Method Summary | |
|---|---|
void |
addBin(Range<T> range)
Adds a new bin to the histogram. |
int |
addValue(T value)
Adds a value to the histogram. |
void |
addValues(List<T> values)
Adds a list of values to the histogram. |
int |
getBinForValue(T value)
Gets the bin index for a value. |
List<Integer> |
getBinForValues(List<T> values)
Gets bin indices for a list of input values. |
List<Integer> |
getCounts()
Gets the count of data items in each bin. |
int |
size()
Gets the number of bins. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_BIN
| Constructor Detail |
|---|
public Histogram()
| Method Detail |
|---|
public void addBin(Range<T> range)
throws org.jaitools.numeric.HistogramException
range - the data range for this bin.
HistogramException - if the new bin overlaps with an existing binpublic int addValue(T value)
value - the value
NO_BINpublic void addValues(List<T> values)
values - input valuespublic int getBinForValue(T value)
value - the value
NO_BINpublic List<Integer> getBinForValues(List<T> values)
values - input values
List of bin indicespublic int size()
public List<Integer> getCounts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||