public class DefaultErrorDataSet extends AbstractErrorDataSet<DefaultErrorDataSet> implements DataSetError
DataSet and DataSetError interface. User provides X and Y
coordinates or only Y coordinates. In the former case X coordinates have value of data point index.DataSet,
DataSetErrorDataSetError.ErrorType| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<DoublePointError> |
data |
protected Map<Integer,String> |
dataLabels |
protected Map<Integer,String> |
dataStyles |
lock, name, updateListeners, xRange, yRangeTAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
DefaultErrorDataSet(String name)
Creates a new instance of
DefaultDataSet. |
DefaultErrorDataSet(String name,
double[] yValues)
Creates a new instance of
DefaultDataSet. |
DefaultErrorDataSet(String name,
double[] xValues,
double[] yValues)
Creates a new instance of
DefaultDataSet. |
DefaultErrorDataSet(String name,
double[] xValues,
double[] yValues,
double[] yErrors)
Creates a new instance of
DefaultDataSet. |
DefaultErrorDataSet(String name,
double[] xValues,
double[] yValues,
double[] xErrors,
double[] yErrors)
Creates a new instance of
DefaultDataSet. |
| Modifier and Type | Method and Description |
|---|---|
DefaultErrorDataSet |
add(double[] xValues,
double[] yValues)
Adds data points to this data set.
|
DefaultErrorDataSet |
add(double[] xValues,
double[] yValues,
double[] xErrors,
double[] yErrors)
Adds data points to this data set.
|
DefaultErrorDataSet |
add(double x,
double y) |
DefaultErrorDataSet |
add(double x,
double y,
double ex,
double ey)
add new point
|
String |
addDataLabel(int index,
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.
|
String |
addDataStyle(int index,
String style)
A string representation of the CSS style associated with this specific
DataSet data point. |
DefaultErrorDataSet |
clearData()
clears all data points
|
List<DoublePointError> |
getData() |
int |
getDataCount()
Get the number of data points in the data set
|
String |
getDataLabel(int index)
Returns label of a data point specified by the index.
|
Map<Integer,String> |
getDataLabelMap() |
Map<Integer,String> |
getDataStyleMap() |
String |
getStyle(int index)
A string representation of the CSS style associated with this
specific
DataSet data point. |
double |
getX(int i)
Gets the x value of the data point with the index i
|
double |
getXErrorNegative(int index)
Returns the negative error along the X axis of a point specified by the
index. |
double |
getXErrorPositive(int index)
Returns the positive error along the X axis of a point specified by the
index. |
double |
getY(int i)
Gets the y value of the data point with the index i
|
double |
getYErrorNegative(int index)
Returns the negative error along the Y axis of a point specified by the
index. |
double |
getYErrorPositive(int index)
Returns the positive error along the Y axis of a point specified by the
index. |
DefaultErrorDataSet |
remove(int[] indices)
Removes from this data set points with specified indices.
|
DefaultErrorDataSet |
remove(int fromIndex,
int toIndex)
remove sub-range of data points
|
String |
removeDataLabel(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.
|
String |
removeStyle(int index)
A string representation of the CSS style associated with this specific
DataSet data point. |
DefaultErrorDataSet |
set(double[] xValues,
double[] yValues)
Initialises the data set with specified data.
|
DefaultErrorDataSet |
set(double[] xValues,
double[] yValues,
double[] xErrors,
double[] yErrors,
int count)
Initialises the data set with specified data.
|
DefaultErrorDataSet |
set(double[] xValues,
double[] yValues,
double[] yErrors,
int count)
Initialises the data set with specified data.
|
DefaultErrorDataSet |
set(double[] xValues,
double[] yValues,
int count)
Initialises the data set with specified data.
|
DefaultErrorDataSet |
set(int index,
double x,
double y)
Sets the point with index to the new coordinate
|
DefaultErrorDataSet |
set(int index,
double x,
double y,
double dx,
double dy)
Sets the point with index to the new coordinate
|
computeLimits, getErrorType, getThis, setErrorTypebinarySearchX, binarySearchY, fireInvalidated, getDataCount, getErrorList, getInfoList, getMetaInfo, getName, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, lock, minNeigbourSearchX, setAutoNotifaction, setName, toString, unlock, updateEventListenergetStyle, setStyleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetErrorType, getXErrorNegative, getXErrorPositive, getXErrorsNegative, getXErrorsPositive, getYErrorNegative, getYErrorPositive, getYErrorsNegative, getYErrorsPositivegetDataCount, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getXValues, getYIndex, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlockaddListener, invokeListener, invokeListener, removeListener, updateEventListenerprotected ArrayList<DoublePointError> data
public DefaultErrorDataSet(String name)
DefaultDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic DefaultErrorDataSet(String name, double[] yValues)
DefaultDataSet. X coordinates are equal to data points indices. name - name of this data set.yValues - Y coordinatesIllegalArgumentException - if any of parameters is nullpublic DefaultErrorDataSet(String name, double[] xValues, double[] yValues)
Creates a new instance of DefaultDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatesIllegalArgumentException - if any of parameters is null or if arrays with coordinates have
different lengthspublic DefaultErrorDataSet(String name, double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)
Creates a new instance of DefaultDataSet.
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 positiveIllegalArgumentException - if any of parameters is null or if arrays with coordinates have
different lengthspublic DefaultErrorDataSet(String name, double[] xValues, double[] yValues, double[] yErrors)
Creates a new instance of DefaultDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatesyErrors - symmetric Y coordinate errors N.B. all errors are assumed to be positiveIllegalArgumentException - if any of parameters is null or if arrays with coordinates have
different lengthspublic Map<Integer,String> getDataLabelMap()
public List<DoublePointError> getData()
public int getDataCount()
DataSetgetDataCount in interface DataSetpublic double getX(int i)
DataSetpublic double getY(int i)
DataSetpublic double getXErrorNegative(int index)
DataSetErrorindex. Please note that
errors are assumed to be always positive!getXErrorNegative in interface DataSetErrorindex - of negative X error to be returned.DataSetError.getXErrorNegative(int)public double getXErrorPositive(int index)
DataSetErrorindex. Please note that
errors are assumed to be always positive!getXErrorPositive in interface DataSetErrorindex - of positive X error to be returned.DataSetError.getXErrorPositive(int)public double getYErrorNegative(int index)
DataSetErrorindex. Please note that
errors are assumed to be always positive!getYErrorNegative in interface DataSetErrorindex - of negative Y error to be returned.DataSetError.getYErrorNegative(int)public double getYErrorPositive(int index)
DataSetErrorindex. Please note that
errors are assumed to be always positive!getYErrorPositive in interface DataSetErrorindex - of positive Y error to be returned.DataSetError.getYErrorPositive(int)public DefaultErrorDataSet set(int index, double x, double y)
index - the point index of the data setx - the horizontal coordinate of the data pointy - the vertical coordinate of the data pointpublic DefaultErrorDataSet clearData()
public DefaultErrorDataSet set(int index, double x, double y, double dx, double dy)
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 errorspublic DefaultErrorDataSet set(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors, int count)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesxErrors - symmetric X coordinate errorsyErrors - symmetric Y coordinate errorscount - number of points to be taken from specified arrays.public DefaultErrorDataSet set(double[] xValues, double[] yValues, int count)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatescount - number of points to be taken from specified arrays.public DefaultErrorDataSet set(double[] xValues, double[] yValues, double[] yErrors, int count)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesyErrors - symmetric Y coordinate errorscount - number of points to be taken from specified arrays.public DefaultErrorDataSet set(double[] xValues, double[] yValues)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatespublic DefaultErrorDataSet add(double x, double y)
x - coordinatey - coordinatepublic DefaultErrorDataSet add(double x, double y, double ex, double ey)
x - horizontal point coordinatey - vertical point coordinateex - horizontal point errorey - vertical point error Note: point errors are expected to be positivepublic DefaultErrorDataSet add(double[] xValues, double[] yValues)
usingXValues flag is set to false - array with X coordinates is not taken into account (may be
null) otherwise both arrays must be non-null and have the same length.xValues - X coordinatesyValues - Y coordinatespublic DefaultErrorDataSet add(double[] xValues, double[] yValues, double[] xErrors, double[] yErrors)
usingXValues flag is set to false - array with X coordinates is not taken into account (may be
null) otherwise both arrays must be non-null and have the same length.xValues - X coordinatesyValues - Y coordinatesxErrors - horizontal errorsyErrors - vertical errorspublic DefaultErrorDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic DefaultErrorDataSet remove(int[] indices)
indices - array of indicices to be removedpublic String addDataLabel(int index, String label)
index - of the data pointlabel - for the data point specified by the indexnull if no label has
been specifiedpublic String removeDataLabel(int index)
index - of the data pointnull if no label has
been specifiedpublic String getDataLabel(int index)
getDataLabel in interface DataSetgetDataLabel in class AbstractDataSet<DefaultErrorDataSet>index - of the data labelnull if no label has been specifiedpublic String addDataStyle(int index, String style)
DataSet data point. @see #getStyle()index - the index of the specific data pointstyle - of the given data point (CSS-styling)public String removeStyle(int index)
DataSet data point. @see #getStyle()index - the index of the specific data pointpublic String getStyle(int index)
DataSet data point. @see #getStyle()Copyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.