Package de.gsi.dataset
Interface DataSet
-
- All Superinterfaces:
EventSource
- All Known Subinterfaces:
DataSet3D,DataSetError,EditableDataSet,Histogram,Histogram1D,TestDataSet<D>
- All Known Implementing Classes:
AbstractDataSet,AbstractDataSet3D,AbstractErrorDataSet,AbstractHistogram,AbstractStylable,AbstractTestFunction,AveragingDataSet,CircularDoubleErrorDataSet,CosineFunction,DefaultDataSet,DefaultErrorDataSet,DoubleDataSet,DoubleDataSet3D,DoubleErrorDataSet,FifoDoubleErrorDataSet,FloatDataSet,FragmentedDataSet,GaussFunction,Histogram,Histogram2,LabelledMarkerDataSet,LimitedIndexedTreeDataSet,ListDataSet,ListErrorDataSet,RandomStepFunction,RandomWalkFunction,RollingDataSet,SincFunction,SineFunction,SingleOutlierFunction,WrappedDataSet
public interface DataSet extends EventSource
Basic interface for observable data sets.- Author:
- original from an unknown author at CERN (JDataViewer), braeun, rstein
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description intgetDataCount()Get the number of data points in the data setintgetDataCount(double xmin, double xmax)Gets the number of data points in the range xmin to xmax.java.lang.StringgetDataLabel(int index)Returns label of a data point specified by the index.java.lang.StringgetName()Gets the name of the data set.java.lang.StringgetStyle()A string representation of the CSS style associated with this specificDataSet.java.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.java.lang.DoublegetUndefValue()Returns the value for undefined data points.default doublegetValue(double x)Gets the interpolated y value of the data point for given x coordinatedoublegetX(int i)Gets the x value of the data point with the index iintgetXIndex(double x)Gets the index of the data point closest to the given x coordinate.doublegetXMax()Gets the maximum x value of the data set.doublegetXMin()Gets the minimum x value of the data set.default double[]getXValues()doublegetY(int i)Gets the y value of the data point with the index iintgetYIndex(double y)Gets the first index of the data point closest to the given y coordinate.doublegetYMax()Gets the maximum y value of the data set.doublegetYMin()Gets the minimum y value of the data set.default double[]getYValues()booleanisAutoNotification()Checks it automatic notification is enabled.DataSetlock()Locks access to the data set.DataSetsetAutoNotifaction(boolean flag)Set the automatic notification of invalidation listeners.DataSetsetStyle(java.lang.String style)A string representation of the CSS style associated with this specificDataSet.DataSetunlock()Unlock the data set.-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, removeListener, updateEventListener
-
-
-
-
Method Detail
-
getName
java.lang.String getName()
Gets the name of the data set.- Returns:
- the name of the DataSet
-
lock
DataSet lock()
Locks access to the data set. Multi-threaded applications should lock the data set before setting the data.- Returns:
- itself (fluent interface)
-
unlock
DataSet unlock()
Unlock the data set.- Returns:
- itself (fluent interface)
-
setAutoNotifaction
DataSet setAutoNotifaction(boolean flag)
Set the automatic notification of invalidation listeners. In general, data sets should notify registered invalidation listeners, if the data in the data set has changed. Charts usually register an invalidation listener with the data set to be notified of any changes and update the charts. Setting the automatic notification to false, allows applications to prevent this behaviour, in case data sets are updated multiple times during an acquisition cycle but the chart update is only required at the end of the cycle.- Parameters:
flag- true for automatic notification- Returns:
- itself (fluent interface)
-
isAutoNotification
boolean isAutoNotification()
Checks it automatic notification is enabled.- Returns:
- true if automatic notification is enabled
-
getDataCount
int getDataCount()
Get the number of data points in the data set- Returns:
- the number of data points
-
getDataCount
int getDataCount(double xmin, double xmax)Gets the number of data points in the range xmin to xmax.- Parameters:
xmin- the lower end of the rangexmax- the upper end of the range- Returns:
- the number of data points
-
getX
double getX(int i)
Gets the x value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the x value
-
getY
double getY(int i)
Gets the y value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the y value
-
getXValues
default double[] getXValues()
- Returns:
- the x value array
-
getYValues
default double[] getYValues()
- Returns:
- the y value array
-
getValue
default double getValue(double x)
Gets the interpolated y value of the data point for given x coordinate- Parameters:
x- the new x coordinate- Returns:
- the y value
-
getUndefValue
java.lang.Double getUndefValue()
Returns the value for undefined data points.- Returns:
- the value indicating undefined data points
-
getXIndex
int getXIndex(double x)
Gets the index of the data point closest to the given x coordinate. The index returned may be less then zero or larger the the number of data points in the data set, if the x coordinate lies outside the range of the data set.- Parameters:
x- the x position of the data point- Returns:
- the index of the data point
-
getYIndex
int getYIndex(double y)
Gets the first index of the data point closest to the given y coordinate.- Parameters:
y- the y position of the data point- Returns:
- the index of the data point
-
getXMin
double getXMin()
Gets the minimum x value of the data set.- Returns:
- minimum x value
-
getXMax
double getXMax()
Gets the maximum x value of the data set.- Returns:
- maximum x value
-
getYMin
double getYMin()
Gets the minimum y value of the data set.- Returns:
- minimum y value
-
getYMax
double getYMax()
Gets the maximum y value of the data set.- Returns:
- maximum y value
-
getDataLabel
java.lang.String getDataLabel(int index)
Returns label of a data point specified by the index. The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Parameters:
index- the data index- Returns:
- label of a data point specified by the index or
nullif none label has been specified for this data point.
-
getStyle
java.lang.String getStyle()
A string representation of the CSS style associated with this specificDataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.- Returns:
- user-specific data set style description (ie. may be set by user)
-
getStyle
java.lang.String getStyle(int index)
A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
setStyle
DataSet setStyle(java.lang.String style)
A string representation of the CSS style associated with this specificDataSet. This is analogous to the "style" attribute of an HTML element. Note that, like the HTML style attribute, this variable contains style properties and values and not the selector portion of a style rule.- Parameters:
style- the new user-specific style- Returns:
- itself (fluent interface)
-
-