Package de.gsi.dataset.spi
Class ListErrorDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<D>
-
- de.gsi.dataset.spi.AbstractErrorDataSet<ListErrorDataSet>
-
- de.gsi.dataset.spi.ListErrorDataSet
-
- All Implemented Interfaces:
DataSet,DataSetError,DataSetMetaData,EventSource
public class ListErrorDataSet extends AbstractErrorDataSet<ListErrorDataSet> implements DataSetError
Deprecated.due to poorer CPU performance (this is kept for reference reasons)Default implementation ofDataSetandDataSetErrorinterface. User provides X and Y coordinates or only Y coordinates. In the former case X coordinates have value of data point index. Symmetric errors in X and Y are implemented N.B. this is a classic list-based implementation. This is a "simple" implementation but has a poorer performance compared to Default- and Double-based DataSets @see DoubleDataSet- Author:
- rstein
- See Also:
for the reference implementation,for an implementation without asymmetric error handling,DataSet,DataSetError
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface de.gsi.dataset.DataSetError
DataSetError.ErrorType
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.ArrayList<DoublePointError>dataDeprecated.protected java.util.Map<java.lang.Integer,java.lang.String>dataLabelsDeprecated.protected java.util.Map<java.lang.Integer,java.lang.String>dataStylesDeprecated.-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
editConstraints, lock, metaInfoMap, name, updateListeners, xRange, yRange
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description ListErrorDataSet(java.lang.String name)Deprecated.Creates a new instance ofDefaultDataSet.ListErrorDataSet(java.lang.String name, double[] yValues)Deprecated.Creates a new instance ofDefaultDataSet.ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues)Deprecated.Creates a new instance ofDefaultDataSet.ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues, double[] yErrors)Deprecated.Creates a new instance ofDefaultDataSet.ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)Deprecated.Creates a new instance ofDefaultDataSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ListErrorDataSetadd(double[] xValues, double[] yValues)Deprecated.Adds data points to this data set.ListErrorDataSetadd(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)Deprecated.Adds data points to this data set.ListErrorDataSetadd(double x, double y)Deprecated.ListErrorDataSetadd(double x, double y, double ex, double ey)Deprecated.add new pointjava.lang.StringaddDataLabel(int index, java.lang.String label)Deprecated.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)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.ListErrorDataSetclearData()Deprecated.clears all data pointsjava.util.List<DoublePointError>getData()Deprecated.intgetDataCount()Deprecated.Get the number of data points in the data setjava.lang.StringgetDataLabel(int index)Deprecated.Returns label of a data point specified by the index.java.util.Map<java.lang.Integer,java.lang.String>getDataLabelMap()Deprecated.java.util.Map<java.lang.Integer,java.lang.String>getDataStyleMap()Deprecated.java.lang.StringgetStyle(int index)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.doublegetX(int i)Deprecated.Gets the x value of the data point with the index idoublegetXErrorNegative(int index)Deprecated.Returns the negative error along the X axis of a point specified by theindex.doublegetXErrorPositive(int index)Deprecated.Returns the positive error along the X axis of a point specified by theindex.doublegetY(int i)Deprecated.Gets the y value of the data point with the index idoublegetYErrorNegative(int index)Deprecated.Returns the negative error along the Y axis of a point specified by theindex.doublegetYErrorPositive(int index)Deprecated.Returns the positive error along the Y axis of a point specified by theindex.ListErrorDataSetremove(int[] indices)Deprecated.Removes from this data set points with specified indices.ListErrorDataSetremove(int fromIndex, int toIndex)Deprecated.remove sub-range of data pointsjava.lang.StringremoveDataLabel(int index)Deprecated.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)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point.ListErrorDataSetset(double[] xValues, double[] yValues)Deprecated.Initialises the data set with specified data.ListErrorDataSetset(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors, int count)Deprecated.Initialises the data set with specified data.ListErrorDataSetset(double[] xValues, double[] yValues, double[] yErrors, int count)Deprecated.Initialises the data set with specified data.ListErrorDataSetset(double[] xValues, double[] yValues, int count)Deprecated.Initialises the data set with specified data.ListErrorDataSetset(int index, double x, double y)Deprecated.Sets the point with index to the new coordinateListErrorDataSetset(int index, double x, double y, double dx, double dy)Deprecated.Sets the point with index to the new coordinate-
Methods inherited from class de.gsi.dataset.spi.AbstractErrorDataSet
computeLimits, fireInvalidated, getErrorType, getThis, lock, setErrorType, unlock
-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
binarySearchX, binarySearchY, getDataCount, getDefaultDataLabel, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, minNeigbourSearchX, setAutoNotifaction, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getDataCount, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getXValues, getYIndex, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlock
-
Methods inherited from interface de.gsi.dataset.DataSetError
getErrorType, getXErrorNegative, getXErrorPositive, getXErrorsNegative, getXErrorsPositive, getYErrorNegative, getYErrorPositive, getYErrorsNegative, getYErrorsPositive
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, removeListener, updateEventListener
-
-
-
-
Field Detail
-
dataLabels
protected java.util.Map<java.lang.Integer,java.lang.String> dataLabels
Deprecated.
-
dataStyles
protected java.util.Map<java.lang.Integer,java.lang.String> dataStyles
Deprecated.
-
data
protected java.util.ArrayList<DoublePointError> data
Deprecated.
-
-
Constructor Detail
-
ListErrorDataSet
public ListErrorDataSet(java.lang.String name)
Deprecated.Creates a new instance ofDefaultDataSet.- Parameters:
name- name of this DataSet.- Throws:
java.lang.IllegalArgumentException- ifnameisnull
-
ListErrorDataSet
public ListErrorDataSet(java.lang.String name, double[] yValues)Deprecated.Creates a new instance ofDefaultDataSet. X coordinates are equal to data points indices.
Note: The provided array is not copied (data set operates on the specified array object) thus the array should not be modified outside of this data set.- Parameters:
name- name of this data set.yValues- Y coordinates- Throws:
java.lang.IllegalArgumentException- if any of parameters isnull
-
ListErrorDataSet
public ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues)Deprecated.Creates a new instance of
Note: The provided arrays are not copied (data set operates on specified array objects) thus these array should not be modified outside of this data set.DefaultDataSet.- Parameters:
name- name of this data set.xValues- X coordinatesyValues- Y coordinates- Throws:
java.lang.IllegalArgumentException- if any of parameters isnullor if arrays with coordinates have different lengths
-
ListErrorDataSet
public ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)Deprecated.Creates a new instance of
Note: The provided arrays are not copied (data set operates on specified array objects) thus these array should not be modified outside of this data set.DefaultDataSet.- Parameters:
name- name of this data set.xValues- X coordinatesyValues- Y coordinatesxErrors- symmetric X coordinate errorsyErrors- symmetric Y coordinate errors N.B. all errors are assumed to be positive- Throws:
java.lang.IllegalArgumentException- if any of parameters isnullor if arrays with coordinates have different lengths
-
ListErrorDataSet
public ListErrorDataSet(java.lang.String name, double[] xValues, double[] yValues, double[] yErrors)Deprecated.Creates a new instance of
Note: The provided arrays are not copied (data set operates on specified array objects) thus these array should not be modified outside of this data set.DefaultDataSet.- Parameters:
name- name of this data set.xValues- X coordinatesyValues- Y coordinatesyErrors- symmetric Y coordinate errors N.B. all errors are assumed to be positive- Throws:
java.lang.IllegalArgumentException- if any of parameters isnullor if arrays with coordinates have different lengths
-
-
Method Detail
-
getDataLabelMap
public java.util.Map<java.lang.Integer,java.lang.String> getDataLabelMap()
Deprecated.- Returns:
- data label map for given data point
-
getDataStyleMap
public java.util.Map<java.lang.Integer,java.lang.String> getDataStyleMap()
Deprecated.- Returns:
- data style map (CSS-styling)
-
getData
public java.util.List<DoublePointError> getData()
Deprecated.- Returns:
- list containing data point definition
-
getDataCount
public int getDataCount()
Deprecated.Description copied from interface:DataSetGet the number of data points in the data set- Specified by:
getDataCountin interfaceDataSet- Returns:
- the number of data points
-
getX
public double getX(int i)
Deprecated.Description copied from interface:DataSetGets the x value of the data point with the index i
-
getY
public double getY(int i)
Deprecated.Description copied from interface:DataSetGets the y value of the data point with the index i
-
getXErrorNegative
public double getXErrorNegative(int index)
Deprecated.Description copied from interface:DataSetErrorReturns the negative error along the X axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getXErrorNegativein interfaceDataSetError- Parameters:
index- of negative X error to be returned.- Returns:
- the negative error of the x coordinate
- See Also:
DataSetError.getXErrorNegative(int)
-
getXErrorPositive
public double getXErrorPositive(int index)
Deprecated.Description copied from interface:DataSetErrorReturns the positive error along the X axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getXErrorPositivein interfaceDataSetError- Parameters:
index- of positive X error to be returned.- Returns:
- the positive error of the x coordinate
- See Also:
DataSetError.getXErrorPositive(int)
-
getYErrorNegative
public double getYErrorNegative(int index)
Deprecated.Description copied from interface:DataSetErrorReturns the negative error along the Y axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getYErrorNegativein interfaceDataSetError- Parameters:
index- of negative Y error to be returned.- Returns:
- the negative error of the y coordinate
- See Also:
DataSetError.getYErrorNegative(int)
-
getYErrorPositive
public double getYErrorPositive(int index)
Deprecated.Description copied from interface:DataSetErrorReturns the positive error along the Y axis of a point specified by theindex. Please note that errors are assumed to be always positive!- Specified by:
getYErrorPositivein interfaceDataSetError- Parameters:
index- of positive Y error to be returned.- Returns:
- the positive error of the y coordinate
- See Also:
DataSetError.getYErrorPositive(int)
-
set
public ListErrorDataSet set(int index, double x, double y)
Deprecated.Sets the point with index to the new coordinate- Parameters:
index- the point index of the data setx- the horizontal coordinate of the data pointy- the vertical coordinate of the data point- Returns:
- itself
-
clearData
public ListErrorDataSet clearData()
Deprecated.clears all data points- Returns:
- itself (fluent design)
-
set
public ListErrorDataSet set(int index, double x, double y, double dx, double dy)
Deprecated.Sets the point with index to the new coordinate- Parameters:
index- the point index of the data setx- the horizontal coordinate of the data pointy- the vertical coordinate of the data pointdx- the horizontal errordy- the vertical error N.B. assumes symmetric errors- Returns:
- itself
-
set
public ListErrorDataSet set(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors, int count)
Deprecated.Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xValues- X coordinatesyValues- Y coordinatesxErrors- symmetric X coordinate errorsyErrors- symmetric Y coordinate errorscount- number of points to be taken from specified arrays.- Returns:
- itself
-
set
public ListErrorDataSet set(double[] xValues, double[] yValues, int count)
Deprecated.Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xValues- X coordinatesyValues- Y coordinatescount- number of points to be taken from specified arrays.- Returns:
- itself
-
set
public ListErrorDataSet set(double[] xValues, double[] yValues, double[] yErrors, int count)
Deprecated.Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xValues- X coordinatesyValues- Y coordinatesyErrors- symmetric Y coordinate errorscount- number of points to be taken from specified arrays.- Returns:
- itself
-
set
public ListErrorDataSet set(double[] xValues, double[] yValues)
Deprecated.Initialises the data set with specified data.
Note: The method copies values from specified double arrays.- Parameters:
xValues- X coordinatesyValues- Y coordinates- Returns:
- itself
-
add
public ListErrorDataSet add(double x, double y)
Deprecated.- Parameters:
x- coordinatey- coordinate- Returns:
- itself
-
add
public ListErrorDataSet add(double x, double y, double ex, double ey)
Deprecated.add new point- Parameters:
x- horizontal point coordinatey- vertical point coordinateex- horizontal point errorey- vertical point error Note: point errors are expected to be positive- Returns:
- itself
-
add
public ListErrorDataSet add(double[] xValues, double[] yValues)
Deprecated.Adds data points to this data set.
IfusingXValuesflag is set to false - array with X coordinates is not taken into account (may benull) otherwise both arrays must be non-null and have the same length.- Parameters:
xValues- X coordinatesyValues- Y coordinates- Returns:
- itself
-
add
public ListErrorDataSet add(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)
Deprecated.Adds data points to this data set.
IfusingXValuesflag is set to false - array with X coordinates is not taken into account (may benull) otherwise both arrays must be non-null and have the same length.- Parameters:
xValues- X coordinatesyValues- Y coordinatesxErrors- horizontal errorsyErrors- vertical errors- Returns:
- itself
-
remove
public ListErrorDataSet remove(int fromIndex, int toIndex)
Deprecated.remove sub-range of data points- Parameters:
fromIndex- start indextoIndex- stop index- Returns:
- itself (fluent design)
-
remove
public ListErrorDataSet remove(int[] indices)
Deprecated.Removes from this data set points with specified indices.- Parameters:
indices- array of indicices to be removed- Returns:
- itself
-
addDataLabel
public java.lang.String addDataLabel(int index, java.lang.String label)Deprecated.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.- Overrides:
addDataLabelin classAbstractDataSet<ListErrorDataSet>- 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
-
removeDataLabel
public java.lang.String removeDataLabel(int index)
Deprecated.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.- Overrides:
removeDataLabelin classAbstractDataSet<ListErrorDataSet>- Parameters:
index- of the data point- Returns:
- the previously set label or
nullif no label has been specified
-
getDataLabel
public java.lang.String getDataLabel(int index)
Deprecated.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.- Specified by:
getDataLabelin interfaceDataSet- Overrides:
getDataLabelin classAbstractDataSet<ListErrorDataSet>- Parameters:
index- of the data label- Returns:
- data point label specified by the index or
nullif no label has been specified
-
addDataStyle
public java.lang.String addDataStyle(int index, java.lang.String style)Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
addDataStylein classAbstractDataSet<ListErrorDataSet>- Parameters:
index- the index of the specific data pointstyle- of the given data point (CSS-styling)- Returns:
- itself (fluent interface)
-
removeStyle
public java.lang.String removeStyle(int index)
Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Overrides:
removeStylein classAbstractDataSet<ListErrorDataSet>- Parameters:
index- the index of the specific data point- Returns:
- itself (fluent interface)
-
getStyle
public java.lang.String getStyle(int index)
Deprecated.A string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<ListErrorDataSet>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
-