Package pamMaths
Class PamLogHistogram
java.lang.Object
java.util.Observable
PamUtils.TimedObservable
pamMaths.PamHistogram
pamMaths.PamLogHistogram
- All Implemented Interfaces:
Cloneable
-
Field Summary
Fields inherited from class pamMaths.PamHistogram
data, hiBin, loBin -
Constructor Summary
ConstructorsConstructorDescriptionPamLogHistogram(double minVal, double maxVal, int nBins) PamLogHistogram(double minVal, double maxVal, int nBins, boolean binCentres) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddData(double newData) Add a single point of data to the histogram but don't notify observersvoidaddData(double newData, boolean notify) Add a single unit value to the histogram and optionally notify all observersvoidaddData(double newData, double weight) Add weighted data to the histogramintgetBin(double dataValue) Work out which bin a particular value will call into.doublegetBinCentre(int iBin) double[]Get the centre value of every bindouble[]Get an array of bin edges.doubleGet the maximum range value of the histogramdoublegetMean()Calculate the mean of the histogram datadoubleGet the minimum range value of the histogramdoubleWhere to plot to if bin centres were specified.doubleWhere to plot from if bin centres were specified.Methods inherited from class pamMaths.PamHistogram
clear, clone, getData, getHiBin, getKurtosis, getLoBin, getMaxContent, getMode, getName, getNBins, getSkew, getSTD, getStep, getTotalContent, getVariance, isBinCentres, printSummary, printSummary, scaleData, setBinCentres, setData, setName, setRange, toStringMethods inherited from class PamUtils.TimedObservable
getDelay, notifyObservers, notifyObservers, notifyObservers, setDelayMethods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, setChanged
-
Constructor Details
-
PamLogHistogram
public PamLogHistogram(double minVal, double maxVal, int nBins) -
PamLogHistogram
public PamLogHistogram(double minVal, double maxVal, int nBins, boolean binCentres) - Parameters:
minVal-maxVal-nBins-binCentres-
-
-
Method Details
-
getBin
public int getBin(double dataValue) Description copied from class:PamHistogramWork out which bin a particular value will call into. N.B. This may return invalid input: '<' 0 or >= getNBins() if the data fall outsied the range of the histogram- Overrides:
getBinin classPamHistogram- Parameters:
dataValue-- Returns:
- bin Bumber
-
getBinCentre
public double getBinCentre(int iBin) - Overrides:
getBinCentrein classPamHistogram
-
addData
public void addData(double newData, boolean notify) Description copied from class:PamHistogramAdd a single unit value to the histogram and optionally notify all observers- Overrides:
addDatain classPamHistogram- Parameters:
newData- value of the new data
-
addData
public void addData(double newData) Description copied from class:PamHistogramAdd a single point of data to the histogram but don't notify observers- Overrides:
addDatain classPamHistogram- Parameters:
newData- new data point
-
addData
public void addData(double newData, double weight) Description copied from class:PamHistogramAdd weighted data to the histogram- Overrides:
addDatain classPamHistogram- Parameters:
newData- value of the dataweight- weight to apply
-
getMean
public double getMean()Description copied from class:PamHistogramCalculate the mean of the histogram data- Overrides:
getMeanin classPamHistogram- Returns:
- mean value
-
getMaxVal
public double getMaxVal()Description copied from class:PamHistogramGet the maximum range value of the histogram- Overrides:
getMaxValin classPamHistogram- Returns:
- max value
-
getMinVal
public double getMinVal()Description copied from class:PamHistogramGet the minimum range value of the histogram- Overrides:
getMinValin classPamHistogram- Returns:
- min value
-
getScaleMinVal
public double getScaleMinVal()Description copied from class:PamHistogramWhere to plot from if bin centres were specified.- Overrides:
getScaleMinValin classPamHistogram- Returns:
- minimum value for plot axis
-
getScaleMaxVal
public double getScaleMaxVal()Description copied from class:PamHistogramWhere to plot to if bin centres were specified.- Overrides:
getScaleMaxValin classPamHistogram- Returns:
- maximum value for plot axis
-
getBinCentreValues
public double[] getBinCentreValues()Description copied from class:PamHistogramGet the centre value of every bin- Overrides:
getBinCentreValuesin classPamHistogram- Returns:
- array of bin centres.
-
getBinEdgeValues
public double[] getBinEdgeValues()Description copied from class:PamHistogramGet an array of bin edges. This will be one longer than the number of bins- Overrides:
getBinEdgeValuesin classPamHistogram- Returns:
- array of bin edge values.
-