Package de.gsi.dataset.spi
Class CircularDoubleErrorDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<D>
-
- de.gsi.dataset.spi.AbstractErrorDataSet<CircularDoubleErrorDataSet>
-
- de.gsi.dataset.spi.CircularDoubleErrorDataSet
-
- All Implemented Interfaces:
DataSet,DataSet2D,DataSetError,DataSetMetaData,EventSource,java.io.Serializable
public class CircularDoubleErrorDataSet extends AbstractErrorDataSet<CircularDoubleErrorDataSet> implements DataSetError, DataSet2D
- Author:
- rstein
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.gsi.dataset.DataSetError
DataSetError.ErrorType
-
-
Field Summary
Fields Modifier and Type Field Description protected CircularBuffer<java.lang.String>dataLabelsprotected CircularBuffer<java.lang.String>dataStylesprotected DoubleCircularBufferxValuesprotected DoubleCircularBufferyErrorsNegprotected DoubleCircularBufferyErrorsPosprotected DoubleCircularBufferyValues-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
axisListener, dimension
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description CircularDoubleErrorDataSet(java.lang.String name, int initalSize)Creates a new instance ofCircularDoubleErrorDataSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CircularDoubleErrorDataSetadd(double[] xVals, double[] yVals, double[] yErrNeg, double[] yErrPos)Initialises the data set with specified data.CircularDoubleErrorDataSetadd(double x, double y, double yErrorNeg, double yErrorPos)Add point to the DoublePoints objectCircularDoubleErrorDataSetadd(double x, double y, double yErrorNeg, double yErrorPos, java.lang.String label)Add point to the DoublePoints objectCircularDoubleErrorDataSetadd(double x, double y, double yErrorNeg, double yErrorPos, java.lang.String label, java.lang.String style)Add point to the DoublePoints objectjava.lang.StringaddDataLabel(int index, java.lang.String label)adds a custom new data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.java.lang.StringaddDataStyle(int index, java.lang.String style)A string representation of the CSS style associated with this specificDataSetdata point.doubleget(int dimIndex, int index)Gets the x value of the data point with the index iintgetDataCount()Get the number of data points in the data set.java.lang.StringgetDataLabel(int index)Returns label of a data point specified by the index.doublegetErrorNegative(int dimIndex, int index)Returns the negative error along the 'dimIndex' axis of a point specified by theindex.doublegetErrorPositive(int dimIndex, int index)Returns the positive error along the 'dimIndex' axis of a point specified by theindex.java.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.java.lang.StringremoveDataLabel(int index)remove a custom data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.java.lang.StringremoveStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.CircularDoubleErrorDataSetreset()resets all dataDataSetset(DataSet other, boolean copy)-
Methods inherited from class de.gsi.dataset.spi.AbstractErrorDataSet
fireInvalidated, getErrorType, getThis, lock, recomputeLimits, setErrorType
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
autoNotification, binarySearch, binarySearch, clearMetaInfo, copyAxisDescription, copyDataLabelsAndStyles, copyMetaData, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, getAxisDescriptions, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getValue, getValues, getWarningList, hashCode, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getAxisDescriptions, getIndex, getName, getStyle, getValue, getValues, lock, recomputeLimits, set, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSet2D
getDimension, getValue, getX, getXIndex, getXValues, getY, getYIndex, getYValues
-
Methods inherited from interface de.gsi.dataset.DataSetError
getErrorNegative, getErrorPositive, getErrorsNegative, getErrorsPositive, getErrorType
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Field Detail
-
xValues
protected DoubleCircularBuffer xValues
-
yValues
protected DoubleCircularBuffer yValues
-
yErrorsPos
protected DoubleCircularBuffer yErrorsPos
-
yErrorsNeg
protected DoubleCircularBuffer yErrorsNeg
-
dataLabels
protected CircularBuffer<java.lang.String> dataLabels
-
dataStyles
protected CircularBuffer<java.lang.String> dataStyles
-
-
Constructor Detail
-
CircularDoubleErrorDataSet
public CircularDoubleErrorDataSet(java.lang.String name, int initalSize)Creates a new instance ofCircularDoubleErrorDataSet.- Parameters:
name- name of this DataSet.initalSize- maximum circular buffer capacity- Throws:
java.lang.IllegalArgumentException- ifnameisnull
-
-
Method Detail
-
add
public CircularDoubleErrorDataSet add(double x, double y, double yErrorNeg, double yErrorPos)
Add point to the DoublePoints object- Parameters:
x- the new x coordinatey- the new y coordinateyErrorNeg- the +dy erroryErrorPos- the -dy error- Returns:
- itself
-
add
public CircularDoubleErrorDataSet add(double x, double y, double yErrorNeg, double yErrorPos, java.lang.String label)
Add point to the DoublePoints object- Parameters:
x- the new x coordinatey- the new y coordinateyErrorNeg- the +dy erroryErrorPos- the -dy errorlabel- the data label- Returns:
- itself
-
add
public CircularDoubleErrorDataSet add(double x, double y, double yErrorNeg, double yErrorPos, java.lang.String label, java.lang.String style)
Add point to the DoublePoints object- Parameters:
x- the new x coordinatey- the new y coordinateyErrorNeg- the +dy erroryErrorPos- the -dy errorlabel- the data labelstyle- the data style string- Returns:
- itself
-
add
public CircularDoubleErrorDataSet add(double[] xVals, double[] yVals, double[] yErrNeg, double[] yErrPos)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xVals- the new x coordinatesyVals- the new y coordinatesyErrNeg- the +dy errorsyErrPos- the -dy errors- Returns:
- itself
-
getDataCount
public int getDataCount()
Description copied from interface:DataSetGet the number of data points in the data set.- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
getDataLabel
public java.lang.String getDataLabel(int index)
Description copied from class:AbstractDataSetReturns 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.- Specified by:
getDataLabelin interfaceDataSet- Overrides:
getDataLabelin classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- of the data label- Returns:
- data point label specified by the index or
nullif no label has been specified
-
getErrorNegative
public double getErrorNegative(int dimIndex, int index)Description copied from interface:DataSetErrorReturns the negative error along the 'dimIndex' axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getErrorNegativein interfaceDataSetError- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')index- of negative 'dimIndex' error to be returned.- Returns:
- negative 'dimIndex' error
-
getErrorPositive
public double getErrorPositive(int dimIndex, int index)Description copied from interface:DataSetErrorReturns the positive error along the 'dimIndex' axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getErrorPositivein interfaceDataSetError- Parameters:
dimIndex- the dimension index (ie. '0' equals 'X', '1' equals 'Y')index- of positive 'dimIndex' error to be returned.- Returns:
- positive 'dimIndex' error
-
getStyle
public java.lang.String getStyle(int index)
Description copied from class:AbstractDataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
get
public final double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
addDataLabel
public java.lang.String addDataLabel(int index, java.lang.String label)Description copied from class:AbstractDataSetadds a custom new data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Overrides:
addDataLabelin classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- of the data pointlabel- for the data point specified by the index- Returns:
- the previously set label or
nullif no label has been specified
-
addDataStyle
public java.lang.String addDataStyle(int index, java.lang.String style)Description copied from class:AbstractDataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
addDataStylein classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- the index of the specific data pointstyle- string for the data point specific CSS-styling- Returns:
- itself (fluent interface)
-
removeStyle
public java.lang.String removeStyle(int index)
Description copied from class:AbstractDataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
removeStylein classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- the index of the specific data point- Returns:
- itself (fluent interface)
-
removeDataLabel
public java.lang.String removeDataLabel(int index)
Description copied from class:AbstractDataSetremove a custom data label for a point The label can be used as a category name if CategoryStepsDefinition is used or for annotations displayed for data points.- Overrides:
removeDataLabelin classAbstractDataSet<CircularDoubleErrorDataSet>- Parameters:
index- of the data point- Returns:
- the previously set label or
nullif no label has been specified
-
reset
public CircularDoubleErrorDataSet reset()
resets all data- Returns:
- itself (fluent design)
-
-