jas2.hist.util
Class TwoDAdapter
- java.lang.Object
-
- java.util.Observable
-
- jas2.hist.util.ObserverAdapter
-
- jas2.hist.util.TwoDAdapter
-
- All Implemented Interfaces:
- DataSource, HasSlices, HasStatistics, HasStyle, Rebinnable2DHistogramData, java.util.Observer
- Direct Known Subclasses:
- ScatterAdapter
public class TwoDAdapter extends ObserverAdapter implements Rebinnable2DHistogramData, HasStyle, HasStatistics, HasSlices
A class which simply acts as a proxy for the DataSource provided as an argument to its constructor. Not very useful in itself, but can be used as a base class for more interesting adapters.
-
-
Constructor Summary
Constructors Constructor and Description TwoDAdapter(Rebinnable2DHistogramData source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intaddSlice(double x, double y, double width, double height, double phi)Create a new slice with the specified initial parametersbooleancanAddRemoveSlices()intgetNSlices()Number of slices currently attached to plotRebinnable1DHistogramDatagetSlice(int n)Get the data corresponding to the slice.SliceParametersgetSliceParameters(int n)Get the parameters of a slice.StatisticsgetStatistics()JASHistStylegetStyle()This method is called by the plot to determine what style to be used for a plot.java.lang.StringgetTitle()Return the caption to be used in the legend for this data.java.lang.String[]getXAxisLabels()intgetXAxisType()intgetXBins()doublegetXMax()doublegetXMin()java.lang.String[]getYAxisLabels()intgetYAxisType()intgetYBins()doublegetYMax()doublegetYMin()booleanisRebinnable()double[][][]rebin(int xbins, double xmin, double xmax, int ybins, double ymin, double ymax, boolean wantErrors, boolean hurry, boolean overflow)voidremoveSlice(int n)Remove a slice from the sourcejava.lang.StringtoString()-
Methods inherited from class jas2.hist.util.ObserverAdapter
addObserver, clearObservable, deleteObserver, deleteObservers, setObservable, update
-
-
-
-
Constructor Detail
-
TwoDAdapter
public TwoDAdapter(Rebinnable2DHistogramData source)
-
-
Method Detail
-
rebin
public double[][][] rebin(int xbins, double xmin, double xmax, int ybins, double ymin, double ymax, boolean wantErrors, boolean hurry, boolean overflow)- Specified by:
rebinin interfaceRebinnable2DHistogramData
-
getXMin
public double getXMin()
- Specified by:
getXMinin interfaceRebinnable2DHistogramData
-
getXMax
public double getXMax()
- Specified by:
getXMaxin interfaceRebinnable2DHistogramData
-
getYMin
public double getYMin()
- Specified by:
getYMinin interfaceRebinnable2DHistogramData
-
getYMax
public double getYMax()
- Specified by:
getYMaxin interfaceRebinnable2DHistogramData
-
getXBins
public int getXBins()
- Specified by:
getXBinsin interfaceRebinnable2DHistogramData
-
getYBins
public int getYBins()
- Specified by:
getYBinsin interfaceRebinnable2DHistogramData
-
isRebinnable
public boolean isRebinnable()
- Specified by:
isRebinnablein interfaceRebinnable2DHistogramData
-
getXAxisType
public int getXAxisType()
- Specified by:
getXAxisTypein interfaceRebinnable2DHistogramData
-
getYAxisType
public int getYAxisType()
- Specified by:
getYAxisTypein interfaceRebinnable2DHistogramData
-
getXAxisLabels
public java.lang.String[] getXAxisLabels()
- Specified by:
getXAxisLabelsin interfaceRebinnable2DHistogramData
-
getYAxisLabels
public java.lang.String[] getYAxisLabels()
- Specified by:
getYAxisLabelsin interfaceRebinnable2DHistogramData
-
getTitle
public java.lang.String getTitle()
Description copied from interface:DataSourceReturn the caption to be used in the legend for this data.- Specified by:
getTitlein interfaceDataSource
-
getStyle
public JASHistStyle getStyle()
Description copied from interface:HasStyleThis method is called by the plot to determine what style to be used for a plot. It is the programmers responsibility to return the correct subclass of JASHistStyle corresponding to the type of data being implemented by the DataSource.- Specified by:
getStylein interfaceHasStyle- Returns:
- The style to be used, or null to use the default style.
- See Also:
JASHist1DHistogramStyle,JASHist2DHistogramStyle,JASHistScatterPlotStyle
-
getStatistics
public Statistics getStatistics()
- Specified by:
getStatisticsin interfaceHasStatistics
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getNSlices
public int getNSlices()
Description copied from interface:HasSlicesNumber of slices currently attached to plot- Specified by:
getNSlicesin interfaceHasSlices
-
getSliceParameters
public SliceParameters getSliceParameters(int n)
Description copied from interface:HasSlicesGet the parameters of a slice. The SliceParameters can subsequently be changed to update the slice.- Specified by:
getSliceParametersin interfaceHasSlices- Parameters:
n- The index of the slice- Returns:
- The Slice parameters of the slice with the specified index
-
getSlice
public Rebinnable1DHistogramData getSlice(int n)
Description copied from interface:HasSlicesGet the data corresponding to the slice. The data will be observable and will notify its observers if the slice changes, or the data from which the slice is derived changes
-
canAddRemoveSlices
public boolean canAddRemoveSlices()
- Specified by:
canAddRemoveSlicesin interfaceHasSlices
-
addSlice
public int addSlice(double x, double y, double width, double height, double phi)Description copied from interface:HasSlicesCreate a new slice with the specified initial parameters
-
removeSlice
public void removeSlice(int n)
Description copied from interface:HasSlicesRemove a slice from the source- Specified by:
removeSlicein interfaceHasSlices- Parameters:
n- The index of the slice
-
-
DataMelt 3.0 © DataMelt by jWork.ORG