public class DoubleDataSet extends AbstractDataSet<DoubleDataSet> implements EditableDataSet
DataSet interface which stores x,y values
in two separate arrays. It provides methods allowing easily manipulate of
data points. for an equivalent implementation with asymmetric errors in Y| Modifier and Type | Field and Description |
|---|---|
protected Map<Integer,String> |
dataLabels |
protected int |
dataMaxIndex |
protected Map<Integer,String> |
dataStyles |
protected EditConstraints |
editConstraints |
protected double[] |
xValues |
protected double[] |
yValues |
lock, name, updateListeners, xRange, yRangeTAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
DoubleDataSet(String name)
Creates a new instance of
DefaultDataSet. |
DoubleDataSet(String name,
double[] yValues)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
double[] yValues,
boolean copy)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
double[] xValues,
double[] yValues)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
double[] xValues,
double[] yValues,
boolean copy)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
int initalSize)
Creates a new instance of
DefaultDataSet. |
| Modifier and Type | Method and Description |
|---|---|
DoubleDataSet |
add(double[] xValuesNew,
double[] yValuesNew)
Initialises the data set with specified data.
|
DoubleDataSet |
add(double x,
double y)
Add point to the end of the data set
|
DoubleDataSet |
add(double x,
double y,
String label)
Add point to the DoublePoints object
|
DoubleDataSet |
add(int index,
double x,
double y)
add point to the data set
|
DoubleDataSet |
add(int index,
double x,
double y,
String label)
add point to the data set
|
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. |
DoubleDataSet |
clearData()
clear all data points
|
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() |
EditConstraints |
getEditConstraints() |
String |
getStyle(int index)
A string representation of the CSS style associated with this specific
DataSet data point. |
double |
getX(int index)
Gets the x value of the data point with the index i
|
double[] |
getXValues() |
double |
getY(int index)
Gets the y value of the data point with the index i
|
double[] |
getYValues() |
EditableDataSet |
remove(int index)
remove point from data set
|
DoubleDataSet |
remove(int fromIndex,
int toIndex)
removes 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. |
DoubleDataSet |
set(DataSet other)
clear old data and overwrite with data from 'other' data set
|
DoubleDataSet |
set(DataSet other,
boolean copy)
clear old data and overwrite with data from 'other' data set
|
DoubleDataSet |
set(double[] xValues,
double[] yValues)
Initialises the data set with specified data.
|
DoubleDataSet |
set(double[] xValues,
double[] yValues,
boolean copy)
Initialises the data set with specified data.
|
DoubleDataSet |
set(int index,
double x,
double y)
modify point in the the data set
|
DoubleDataSet |
setEditConstraints(EditConstraints constraints) |
binarySearchX, binarySearchY, computeLimits, fireInvalidated, getDataCount, getErrorList, getInfoList, getMetaInfo, getName, getThis, 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, waitsetNamegetDataCount, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getYIndex, getYMax, getYMin, isAutoNotification, lock, setAutoNotifaction, setStyle, unlockaddListener, invokeListener, invokeListener, removeListener, updateEventListenerprotected EditConstraints editConstraints
protected double[] xValues
protected double[] yValues
protected int dataMaxIndex
public DoubleDataSet(String name)
DefaultDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic DoubleDataSet(String name, int initalSize)
DefaultDataSet.name - name of this DataSet.initalSize - initial buffer sizeIllegalArgumentException - if name is nullpublic DoubleDataSet(String name, double[] yValues)
DoubleDataSet. X coordinates are
equal to data points indices. name - name of this data set.yValues - Y coordinatesIllegalArgumentException - if any of parameters is nullpublic DoubleDataSet(String name, double[] yValues, boolean copy)
DoubleDataSet. X coordinates are
equal to data points indices. name - name of this data set.yValues - Y coordinatescopy - if true, the input array is copiedIllegalArgumentException - if any of parameters is nullpublic DoubleDataSet(String name, double[] xValues, double[] yValues)
Creates a new instance of DoubleDataSet.
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 DoubleDataSet(String name, double[] xValues, double[] yValues, boolean copy)
Creates a new instance of DoubleDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatescopy - if true, the input array is copiedIllegalArgumentException - if any of parameters is null or if arrays with
coordinates have different lengthspublic Map<Integer,String> getDataLabelMap()
public double[] getXValues()
getXValues in interface DataSetpublic double[] getYValues()
getYValues in interface DataSetpublic int getDataCount()
DataSetgetDataCount in interface DataSetpublic DoubleDataSet clearData()
public double getX(int index)
DataSetpublic double getY(int index)
DataSetpublic DoubleDataSet set(int index, double x, double y)
EditableDataSetset in interface EditableDataSetindex - data point index at which the new data point should be addedx - horizontal coordinate of the new data pointy - vertical coordinate of the new data pointpublic DoubleDataSet add(double x, double y)
x - indexy - indexpublic DoubleDataSet add(double x, double y, String label)
x - indexy - indexlabel - the data labelpublic DoubleDataSet add(int index, double x, double y)
add in interface EditableDataSetindex - data point index at which the new data point should be addedx - horizontal coordinate of the new data pointy - vertical coordinate of the new data pointpublic DoubleDataSet add(int index, double x, double y, String label)
index - data point index at which the new data point should be addedx - horizontal coordinate of the new data pointy - vertical coordinate of the new data pointlabel - data point label (see CategoryAxis)public DoubleDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic EditableDataSet remove(int index)
remove in interface EditableDataSetindex - data point which should be removedpublic DoubleDataSet add(double[] xValuesNew, double[] yValuesNew)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValuesNew - X coordinatesyValuesNew - Y coordinatespublic DoubleDataSet set(double[] xValues, double[] yValues, boolean copy)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatescopy - true: makes an internal copy, false: use the pointer as is
(saves memory allocationpublic DoubleDataSet 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 DoubleDataSet set(DataSet other)
other - the source data setpublic DoubleDataSet set(DataSet other, boolean copy)
other - the source data setcopy - true: data is passed as a copy, false: data is passed by referencepublic 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<DoubleDataSet>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 - string for the data point specific CSS-stylingpublic 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()public EditConstraints getEditConstraints()
getEditConstraints in interface EditableDataSetpublic DoubleDataSet setEditConstraints(EditConstraints constraints)
setEditConstraints in interface EditableDataSetconstraints - new edit constraintsCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.