Histogram, java.io.Serializablepublic class HistogramNotSoSimple extends java.lang.Object implements Histogram, java.io.Serializable
| Modifier and Type | Field | Description |
|---|---|---|
protected long |
count |
|
protected int[] |
counts |
|
protected double |
deltaX |
|
protected boolean |
doAveraging |
|
protected double[] |
histogram |
|
protected int |
nBins |
|
protected double[] |
sums |
|
protected double |
totalSum |
|
protected double |
xMax |
|
protected double |
xMin |
|
protected double[] |
xValues |
| Constructor | Description |
|---|---|
HistogramNotSoSimple(int n,
DoubleRange xRange) |
Makes a new histogram instance, with the range of x values given by
xRange and n bins.
|
HistogramNotSoSimple(DoubleRange xRange) |
Makes a new histogram instance, with the range of x values given by
xRange.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addValue(double x) |
Adds the given value to the Histogram
|
void |
addValue(double x,
double y) |
|
long |
getCount() |
Returns the number of times the Histogram's addValue method was called.
|
boolean |
getDoAveraging() |
|
double[] |
getHistogram() |
Returns the histogram as an array of doubles
|
int |
getNBins() |
Returns the number of bins in the histogram.
|
DoubleRange |
getXRange() |
Returns the range of x values (min and max) used in the histogram.
|
void |
reset() |
resets all histogram values and counts to zero
|
void |
setDoAveraging(boolean doAveraging) |
turns "averaging" on or off.
|
void |
setNBins(int n) |
Sets the number of bins used by the Histogram.
|
void |
setXRange(DoubleRange xRange) |
Sets the range of x values used in the histogram (min and max).
|
double[] |
xValues() |
Returns the x values from the histogram as an array of doubles
|
protected double deltaX
protected long count
protected double totalSum
protected int[] counts
protected double[] sums
protected double[] histogram
protected double[] xValues
protected double xMin
protected double xMax
protected int nBins
protected boolean doAveraging
public HistogramNotSoSimple(DoubleRange xRange)
public HistogramNotSoSimple(int n,
DoubleRange xRange)
public void reset()
Histogrampublic void addValue(double x,
double y)
public void addValue(double x)
Histogrampublic void setXRange(DoubleRange xRange)
Histogrampublic DoubleRange getXRange()
Histogrampublic int getNBins()
Histogrampublic void setNBins(int n)
Histogrampublic double[] getHistogram()
HistogramgetHistogram in interface Histogrampublic void setDoAveraging(boolean doAveraging)
public boolean getDoAveraging()
public long getCount()
Histogram