Package cnuphys.splot.pdata
Class DataColumn
java.lang.Object
cnuphys.splot.pdata.GrowableArray
cnuphys.splot.pdata.DataColumn
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Fitprotected Stringprotected DataColumnTypeprotected booleanFields inherited from class cnuphys.splot.pdata.GrowableArray
_data, _dataLen, _increment, _initCap, _maxValue, _minValue -
Constructor Summary
ConstructorsConstructorDescriptionDataColumn(DataColumnType type, String name) Creates a DataColumn with initial capacity 100 and increment 100.DataColumn(DataColumnType type, String name, int initCap, int increment) Create a DataColumn -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(double val) Add a value to the array, growing it if necessary.voidclear()Reset the data array to the initial capacity and fill with all NaNs.getFit()Get the FitThis gets the histogram data, which for non-histograms will benull.This gets the histogram 2D data, which for non-histograms will benull.doublegetMean()Get the meangetName()Get the name of the arraydoubleGet the standard deviationgetStyle()Get the style for this columngetType()Get the type of this data columndoubleGet the variance.voidhisto2DAdd(double xval, double yval) Add used only by 2D histogramsprotected voidinitFit()Initialize a fit objectprotected voidInit the style sort of randomlybooleanChecks whether this is a 1D histogrambooleanChecks whether this is a 2D histogrambooleanCheck whether this "curve" is visible.voidset(int index, double val) Set the value at the given indexprotected voidsetHistoData(HistoData histo) Set the histogram data containerprotected voidsetHistoData2D(Histo2DData histo2D) Set the histogram 2D data containervoidSet the nameprotected voidSet the stylevoidsetVisible(boolean visible) Set whether this "curve" is visible.toString()Get a string representationMethods inherited from class cnuphys.splot.pdata.GrowableArray
get, getMaxValue, getMinimalCopy, getMinValue, removeFirst, size
-
Field Details
-
_fit
-
_name
-
_type
-
_visible
protected boolean _visible
-
-
Constructor Details
-
DataColumn
Creates a DataColumn with initial capacity 100 and increment 100.- Parameters:
name- the column name
-
DataColumn
Create a DataColumn- Parameters:
name- the column nameinitCap- the initial capacityincrement- the increment when the array grows.
-
-
Method Details
-
getHistoData
This gets the histogram data, which for non-histograms will benull.- Returns:
- the histogram data
-
setHistoData
Set the histogram data container- Parameters:
histo- the histogram data
-
getHistoData2D
This gets the histogram 2D data, which for non-histograms will benull.- Returns:
- the histogram 2D data
-
setHistoData2D
Set the histogram 2D data container- Parameters:
histo2D- the histogram 2D data
-
isHistogram1D
public boolean isHistogram1D()Checks whether this is a 1D histogram- Returns:
trueif this is a 1D histogram
-
isHistogram2D
public boolean isHistogram2D()Checks whether this is a 2D histogram- Returns:
trueif this is a 2D histogram
-
isVisible
public boolean isVisible()Check whether this "curve" is visible. Only relevant for Y columns.- Returns:
- the visibility flag
-
setName
Set the name- Parameters:
name- the name of the data column
-
getName
Get the name of the array- Returns:
- the name of the array
-
setVisible
public void setVisible(boolean visible) Set whether this "curve" is visible. Only relevant for Y columns.- Parameters:
visible- the visibility flag.
-
getType
Get the type of this data column- Returns:
- the type of this data column
-
initStyle
protected void initStyle()Init the style sort of randomly -
initFit
protected void initFit()Initialize a fit object -
setStyle
Set the style- Parameters:
style- the new style
-
getStyle
Get the style for this column- Returns:
- the style for this column
-
toString
Get a string representation -
getFit
Get the Fit- Returns:
- the fit
-
histo2DAdd
public void histo2DAdd(double xval, double yval) Add used only by 2D histograms- Parameters:
xval- the x valueyval- the y value
-
add
public void add(double val) Add a value to the array, growing it if necessary.- Overrides:
addin classGrowableArray- Parameters:
val- the value to add
-
getMean
public double getMean()Get the mean- Returns:
- the mean
-
getVariance
public double getVariance()Get the variance. Note: divides by N, not N-1- Returns:
- the variance.
-
getStandardDeviation
public double getStandardDeviation()Get the standard deviation- Returns:
- the standard deviation
-
clear
public void clear()Reset the data array to the initial capacity and fill with all NaNs.- Overrides:
clearin classGrowableArray
-
set
public void set(int index, double val) Set the value at the given index- Overrides:
setin classGrowableArray- Parameters:
index- the indexval- the value at the index
-