jas2.swingstudio
Class JASRebinAdaptor
- java.lang.Object
-
- java.util.Observable
-
- jas2.swingstudio.JASRebinAdaptor
-
- All Implemented Interfaces:
- DataSource, ExtendedStatistics, HasStatistics, HasStyle, Rebinnable1DHistogramData, Statistics, java.util.Observer
public class JASRebinAdaptor extends java.util.Observable implements Rebinnable1DHistogramData, java.util.Observer, HasStyle, HasStatistics, ExtendedStatistics
-
-
Constructor Summary
Constructors Constructor and Description JASRebinAdaptor(RemoteRebinnable1DHistogramData source, RMIDestination obs)
-
Method Summary
All Methods Instance Methods Concrete 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 usejava.lang.ObjectgetExtendedStatistic(java.lang.String name)Returns an object corresponding to the named statistic.doublegetMax()Returns the (suggested) maximum value for the X axisdoublegetMin()Returns the (suggested) minimum value for the X axisdoublegetStatistic(java.lang.String name)java.lang.String[]getStatisticNames()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.booleanisRebinnable()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)Fetch binned data from remote data source.java.lang.StringtoString()voidupdate(java.util.Observable obs, java.lang.Object arg)
-
-
-
Constructor Detail
-
JASRebinAdaptor
public JASRebinAdaptor(RemoteRebinnable1DHistogramData source, RMIDestination obs)
-
-
Method Detail
-
update
public void update(java.util.Observable obs, java.lang.Object arg)- Specified by:
updatein interfacejava.util.Observer
-
rebin
public double[][] rebin(int bins, double min, double max, boolean wantErrors, boolean hurry)Fetch binned data from remote data source. Also caches result to speed up subsequent requests for the same binned data.- Specified by:
rebinin interfaceRebinnable1DHistogramDatamin- 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
public double getMin()
Description copied from interface:Rebinnable1DHistogramDataReturns the (suggested) minimum value for the X axis- Specified by:
getMinin interfaceRebinnable1DHistogramData
-
getMax
public double getMax()
Description copied from interface:Rebinnable1DHistogramDataReturns the (suggested) maximum value for the X axis- Specified by:
getMaxin interfaceRebinnable1DHistogramData
-
getBins
public int getBins()
Description copied from interface:Rebinnable1DHistogramDataReturns the (suggested) number of bins to use- Specified by:
getBinsin interfaceRebinnable1DHistogramData
-
getAxisType
public int getAxisType()
Description copied from interface:Rebinnable1DHistogramDataReturns one of DOUBLE,INTEGER,STRING,DATE or DELTATIME- Specified by:
getAxisTypein interfaceRebinnable1DHistogramData
-
isRebinnable
public boolean isRebinnable()
Description copied from interface:Rebinnable1DHistogramDataReturns 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.- Specified by:
isRebinnablein interfaceRebinnable1DHistogramData- Returns:
- True if the datasource is rebinnable
-
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
-
getAxisLabels
public java.lang.String[] getAxisLabels()
Description copied from interface:Rebinnable1DHistogramDataReturns the axis labels. Only relevant if the axisType is STRING, otherwise can return null- Specified by:
getAxisLabelsin interfaceRebinnable1DHistogramData- Returns:
- An array of bin labels to use on the X axis
-
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
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getStatistics
public Statistics getStatistics()
- Specified by:
getStatisticsin interfaceHasStatistics
-
getStatisticNames
public java.lang.String[] getStatisticNames()
- Specified by:
getStatisticNamesin interfaceStatistics- Returns:
- A list of statistic names
-
getStatistic
public double getStatistic(java.lang.String name)
- Specified by:
getStatisticin interfaceStatistics- Returns:
- The value for the statistic
-
getExtendedStatistic
public java.lang.Object getExtendedStatistic(java.lang.String name)
Description copied from interface:ExtendedStatisticsReturns an object corresponding to the named statistic. In general the statistic will be displayed by calling its toString method, however if a Format object has been defined for this class (how?) then it will be used instead. By default the following formatters are defined- java.lang.Double
- jas2.util.ScientificFormat
- jas2.util.DoubleWithError
- jas2.util.ScientificFormat
- Specified by:
getExtendedStatisticin interfaceExtendedStatistics- Parameters:
name- The name of the statistic to return- See Also:
ScientificFormat,DoubleWithError
-
-
DataMelt 3.0 © DataMelt by jWork.ORG