public class DoubleDataSet extends AbstractDataSet<DoubleDataSet> implements EditableDataSet, DataSet2D
DataSet interface which stores x,y values in two separate arrays. It provides methods
allowing easily manipulate of data points.for an implementation with asymmetric errors in Y,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
xValues |
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
yValues |
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
DoubleDataSet(DataSet another)
Creates a new instance of
DoubleDataSet as copy of another (deep-copy). |
DoubleDataSet(String name)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
double[] xValues,
double[] yValues,
int initalSize,
boolean deepCopy)
Creates a new instance of
DoubleDataSet. |
DoubleDataSet(String name,
int initalSize)
Creates a new instance of
DoubleDataSet. |
| Modifier and Type | Method and Description |
|---|---|
DoubleDataSet |
add(double[] xValuesNew,
double[] yValuesNew)
Add array vectors to data set.
|
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 data set.
|
DoubleDataSet |
add(int index,
double... newValue)
add point to the data set
|
DoubleDataSet |
add(int index,
double[] x,
double[] y)
add point to the data set
|
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
|
DoubleDataSet |
clearData()
clear all data points
|
double |
get(int dimIndex,
int index)
Gets the x value of the data point with the index i
|
int |
getCapacity() |
int |
getDataCount()
Get the number of data points in the data set.
|
double[] |
getValues(int dimIndex) |
DoubleDataSet |
increaseCapacity(int amount) |
EditableDataSet |
remove(int index)
remove point from data set
|
DoubleDataSet |
remove(int fromIndex,
int toIndex)
removes sub-range of data points
|
DoubleDataSet |
resize(int size)
ensures minimum size, enlarges if necessary
|
DoubleDataSet |
set(DataSet other)
clear old data and overwrite with data from 'other' data set (deep copy)
|
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... newValue)
replaces point coordinate of existing data point
|
DoubleDataSet |
set(int index,
double[] x,
double[] y) |
DoubleDataSet |
set(int index,
double x,
double y)
replaces point coordinate of existing data point
|
DoubleDataSet |
trim()
Trims the arrays list so that the capacity is equal to the size.
|
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getThis, getWarningList, hashCode, lock, minNeigbourSearchX, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListenergetStyle, setStyleclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetEditConstraints, setEditConstraints, setNamegetDataCount, getDimension, getValue, getValue, getX, getXIndex, getXValues, getY, getYIndex, getYValuesgetAxisDescription, getAxisDescriptions, getDataLabel, getIndex, getName, getStyle, getStyle, lock, recomputeLimits, setStyleaddListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListenerprotected it.unimi.dsi.fastutil.doubles.DoubleArrayList xValues
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yValues
public DoubleDataSet(DataSet another)
DoubleDataSet as copy of another (deep-copy).another - name of this DataSet.public DoubleDataSet(String name)
DoubleDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic DoubleDataSet(String name, double[] xValues, double[] yValues, int initalSize, boolean deepCopy)
Creates a new instance of DoubleDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatesinitalSize - how many data points are relevant to be takendeepCopy - if true, the input array is copiedIllegalArgumentException - if any of the parameters is null or if arrays with coordinates have
different lengthspublic DoubleDataSet(String name, int initalSize)
DoubleDataSet.name - name of this DataSet.initalSize - initial capacity of buffer (N.B. size=0)IllegalArgumentException - if name is nullpublic DoubleDataSet add(double x, double y)
x - indexy - indexpublic DoubleDataSet add(double x, double y, String label)
x - horizontal coordinate of the new data pointy - vertical coordinate of the new data pointlabel - the data labelpublic DoubleDataSet add(double[] xValuesNew, double[] yValuesNew)
xValuesNew - X coordinatesyValuesNew - Y coordinatespublic DoubleDataSet add(int index, double... newValue)
add in interface EditableDataSetindex - data point index at which the new data point should be addednewValue - new data point coordinatepublic DoubleDataSet add(int index, double x, double y)
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 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 coordinates of the new data pointy - vertical coordinates of the new data pointlabel - data point label (see CategoryAxis)public DoubleDataSet add(int index, double[] x, double[] y)
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 pointpublic DoubleDataSet clearData()
public final double get(int dimIndex,
int index)
DataSetpublic int getCapacity()
public int getDataCount()
DataSetgetDataCount in interface DataSetgetDataCount in interface DataSet2Dpublic final double[] getValues(int dimIndex)
public DoubleDataSet increaseCapacity(int amount)
amount - storage capacity increasepublic EditableDataSet remove(int index)
remove in interface EditableDataSetindex - data point which should be removedpublic DoubleDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic DoubleDataSet resize(int size)
size - the actually used array lengthspublic DoubleDataSet set(DataSet other)
other - the source data setpublic 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(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(int index, double... newValue)
set in interface EditableDataSetindex - data point index at which the new data point should be addednewValue - new data point coordinatepublic DoubleDataSet set(int index, double x, double y)
index - the index of the data pointx - new horizontal coordinatey - new vertical coordinate N.B. errors are implicitly assumed to be zeropublic DoubleDataSet set(int index, double[] x, double[] y)
public DoubleDataSet trim()
ArrayList.trimToSize()Copyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.