public class DefaultDataSet extends AbstractDataSet<DefaultDataSet> implements DataSet
DataSet interface which keeps the x,y
values in an observable list. It provides methods allowing easily manipulate
of data points. | Modifier and Type | Field and Description |
|---|---|
protected ArrayList<DoublePoint> |
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 |
|---|
DefaultDataSet(String name)
Creates a new instance of
DefaultDataSet. |
DefaultDataSet(String name,
double[] yValues)
Creates a new instance of
DefaultDataSet. |
DefaultDataSet(String name,
double[] xValues,
double[] yValues)
Creates a new instance of
DefaultDataSet. |
DefaultDataSet(String name,
List<DoublePoint> values)
Creates a new instance of
DefaultDataSet. |
| Modifier and Type | Method and Description |
|---|---|
DefaultDataSet |
add(double[] xValues,
double[] yValues)
Initialises the data set with specified data.
|
DefaultDataSet |
add(double x,
double y)
Add point to the DoublePoints object
|
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. |
DefaultDataSet |
clearData()
clear all data points
|
List<DoublePoint> |
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 index)
Gets the x value of the data point with the index i
|
double |
getY(int index)
Gets the y value of the data point with the index i
|
DefaultDataSet |
remove(int[] indices)
Removes from this data set points with specified indices.
|
DefaultDataSet |
remove(int fromIndex,
int toIndex)
remvove 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. |
DefaultDataSet |
set(int index,
double x,
double y)
sets new value of existing data point
|
DefaultDataSet |
set(List<DoublePoint> values)
replaces values of all existing data points
|
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, waitgetDataCount, getName, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getXValues, getYIndex, getYMax, getYMin, getYValues, isAutoNotification, lock, setAutoNotifaction, setStyle, unlockaddListener, invokeListener, invokeListener, removeListener, updateEventListenerprotected ArrayList<DoublePoint> data
public DefaultDataSet(String name)
DefaultDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic DefaultDataSet(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 DefaultDataSet(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 DefaultDataSet(String name, List<DoublePoint> values)
Creates a new instance of DefaultDataSet.
name - name of this data set.values - list of data points to setIllegalArgumentException - if any of parameters is null or if arrays with
coordinates have different lengthspublic Map<Integer,String> getDataLabelMap()
public List<DoublePoint> getData()
public int getDataCount()
DataSetgetDataCount in interface DataSetpublic DefaultDataSet clearData()
public double getX(int index)
DataSetpublic double getY(int index)
DataSetpublic DefaultDataSet set(List<DoublePoint> values)
values - new data pointspublic DefaultDataSet set(int index, double x, double y)
index - data point indexx - new horizontal valuey - new vertical valuepublic DefaultDataSet add(double x, double y)
x - coordinatey - coordinatepublic DefaultDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic DefaultDataSet remove(int[] indices)
indices - array of indices to be removedpublic DefaultDataSet add(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 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<DefaultDataSet>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 - for 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.