jas2.hist
Interface Rebinnable1DHistogramData
-
- All Superinterfaces:
- DataSource
- All Known Subinterfaces:
- Rebinnable1DVariableHistogramData
- All Known Implementing Classes:
- Gauss, JASRebinAdaptor, MemoryDataSource, OneDAdapter, OneDTreeData, RefHistogram1D, StringGauss, TimeGauss
public interface Rebinnable1DHistogramData extends DataSource
This is the interface that must be implemented by any data source for a 1D histogram. Despite the name, the data does not actually have to be rebinnable, the isRebinnable() method should return false if the data cannot be rebinned.- See Also:
Rebinnable2DHistogramData
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description java.lang.String[]getAxisLabels()Returns the axis labels.intgetAxisType()Returns one of DOUBLE,INTEGER,STRING,DATE or DELTATIMEintgetBins()Returns the (suggested) number of bins to usedoublegetMax()Returns the (suggested) maximum value for the X axisdoublegetMin()Returns the (suggested) minimum value for the X axisbooleanisRebinnable()Returns true if the data source is capable of recalculating the bin contents, or false of the interface is not-capable of recalculating the bin contents.double[][]rebin(int bins, double min, double max, boolean wantErrors, boolean hurry)Called to request the binned data be returned.-
Methods inherited from interface jas2.hist.DataSource
getTitle
-
-
-
-
Method Detail
-
rebin
double[][] rebin(int bins, double min, double max, boolean wantErrors, boolean hurry)Called to request the binned data be returned. If the DataSource indicated it was not rebinnable then the bins, min and max arguments are guaranteed to be the same values as returned by getMin(), getMax() and getBins() methods.The routine returns a two dimensional array where the first dimension has the following meaning:
- [0] An array of data points (one entry per bin)
- [1] An array of plus errors (one entry per bin)
- [2] An array of minus errors (one entry per bin)
- Parameters:
bin- The number of bins requestedmin- The min of the range over which to binmax- The max of the range over which to binwantErrors- If false indicates that the errors are not required and need not be calculated (most implementations will ignore this parameter)hurry- If true indicates the results should be provided as fast as possible, even if some approximation is needed (most implementations will ignore this parameter)- Returns:
- An array representing the binned data and errors (see description above)
-
getMin
double getMin()
Returns the (suggested) minimum value for the X axis
-
getMax
double getMax()
Returns the (suggested) maximum value for the X axis
-
getBins
int getBins()
Returns the (suggested) number of bins to use
-
isRebinnable
boolean isRebinnable()
Returns true if the data source is capable of recalculating the bin contents, or false of the interface is not-capable of recalculating the bin contents. In the former case the values returned by getMin, getMax and getBins are just taken to be suggestions, in the latter case they are taken to be fixed in stone.- Returns:
- True if the datasource is rebinnable
-
getAxisType
int getAxisType()
Returns one of DOUBLE,INTEGER,STRING,DATE or DELTATIME
-
getAxisLabels
java.lang.String[] getAxisLabels()
Returns the axis labels. Only relevant if the axisType is STRING, otherwise can return null- Returns:
- An array of bin labels to use on the X axis
-
-
DataMelt 3.0 © DataMelt by jWork.ORG