public class DoubleErrorDataSet extends AbstractErrorDataSet<DoubleErrorDataSet> implements DataSetError, EditableDataSet, DataSet2D
DataSetError interface which stores x,y, +eyn, and -eyn values in separate double
arrays. It provides methods allowing easily manipulate of data points.for an implementation without errors,
Serialized FormDataSetError.ErrorType| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
xValues |
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
yErrorsNeg |
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
yErrorsPos |
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList |
yValues |
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
DoubleErrorDataSet(DataSet another)
Creates a new instance of
DoubleErrorDataSet as copy of another (deep-copy). |
DoubleErrorDataSet(String name)
Creates a new instance of
DoubleErrorDataSet. |
DoubleErrorDataSet(String name,
double[] xValues,
double[] yValues,
double[] yErrorsNeg,
double[] yErrorsPos,
int initalSize,
boolean deepCopy)
Creates a new instance of
DoubleErrorDataSet. |
DoubleErrorDataSet(String name,
int initalSize)
Creates a new instance of
DoubleErrorDataSet. |
| Modifier and Type | Method and Description |
|---|---|
DoubleErrorDataSet |
add(double[] xValuesNew,
double[] yValuesNew,
double[] yErrorsNegNew,
double[] yErrorsPosNew)
Add array vectors to data set.
|
DoubleErrorDataSet |
add(double x,
double y)
add point to the data set
|
DoubleErrorDataSet |
add(double x,
double y,
double yErrorNeg,
double yErrorPos)
Add point to the data set.
|
DoubleErrorDataSet |
add(double x,
double y,
double yErrorNeg,
double yErrorPos,
String label)
Add point to the data set.
|
DoubleErrorDataSet |
add(int index,
double... newValue)
add point to the data set
|
DoubleErrorDataSet |
add(int index,
double[] x,
double[] y,
double[] yErrorNeg,
double[] yErrorPos)
add point to the data set
|
DoubleErrorDataSet |
add(int index,
double x,
double y)
add point to the data set
|
DoubleErrorDataSet |
add(int index,
double x,
double y,
double yErrorNeg,
double yErrorPos)
add point to the data set
|
DoubleErrorDataSet |
add(int index,
double x,
double y,
double yErrorNeg,
double yErrorPos,
String label)
add point to the data set
|
DoubleErrorDataSet |
clearData()
clears all data
|
double |
get(int dimIndex,
int index)
Gets the x value of the data point with the index i
|
int |
getCapacity() |
int |
getDataCount(int dimIndex)
Get the number of data points in the data set for a specific dimension.
|
double |
getErrorNegative(int dimIndex,
int index)
Returns the negative error along the 'dimIndex' axis of a point specified by the
index. |
double |
getErrorPositive(int dimIndex,
int index)
Returns the positive error along the 'dimIndex' axis of a point specified by the
index. |
double[] |
getErrorsNegative(int dimIndex)
Returns the negative error along the 'dimIndex' axis for all available data points.
|
double[] |
getErrorsPositive(int dimIndex)
Returns the positive error along the 'dimIndex' axis for all available data points.
|
double[] |
getValues(int dimIndex) |
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() |
DoubleErrorDataSet |
increaseCapacity(int amount) |
DoubleErrorDataSet |
remove(int index)
remove point from data set
|
DoubleErrorDataSet |
remove(int fromIndex,
int toIndex)
remove sub-range of data points
|
DoubleErrorDataSet |
resize(int size)
ensures minimum size, enlarges if necessary
|
DoubleErrorDataSet |
set(DataSet other)
clear old data and overwrite with data from 'other' data set (deep copy)
|
DoubleErrorDataSet |
set(double[] xValues,
double[] yValues,
double[] yErrorsNeg,
double[] yErrorsPos)
Initialises the data set with specified data.
|
DoubleErrorDataSet |
set(double[] xValues,
double[] yValues,
double[] yErrorsNeg,
double[] yErrorsPos,
boolean copy)
Initialises the data set with specified data.
|
DoubleErrorDataSet |
set(double[] xValues,
double[] yValues,
double[] yErrorsNeg,
double[] yErrorsPos,
int nSamples,
boolean copy)
Initialises the data set with specified data.
|
DoubleErrorDataSet |
set(int index,
double... newValue)
replaces point coordinate of existing data point
|
DoubleErrorDataSet |
set(int index,
double[] x,
double[] y,
double[] yErrorNeg,
double[] yErrorPos) |
DoubleErrorDataSet |
set(int index,
double x,
double y)
replaces point coordinate of existing data point
|
DoubleErrorDataSet |
set(int index,
double x,
double y,
double yErrorNeg,
double yErrorPos)
replaces point coordinate of existing data point
|
DoubleErrorDataSet |
trim()
Trims the arrays list so that the capacity is equal to the size.
|
fireInvalidated, getErrorType, getThis, lock, recomputeLimits, setErrorTypeaddDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getStyle, getWarningList, hashCode, minNeigbourSearchX, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListenergetStyle, setStyleclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetErrorNegative, getErrorPositive, getErrorTypegetEditConstraints, setEditConstraints, setNamegetDimension, getValue, getValue, getXIndex, getYIndexgetAxisDescription, getAxisDescriptions, getDataCount, 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
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsPos
protected it.unimi.dsi.fastutil.doubles.DoubleArrayList yErrorsNeg
public DoubleErrorDataSet(DataSet another)
DoubleErrorDataSet as copy of another (deep-copy).another - name of this DataSet.public DoubleErrorDataSet(String name)
DoubleErrorDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic DoubleErrorDataSet(String name, double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, int initalSize, boolean deepCopy)
Creates a new instance of DoubleErrorDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatesyErrorsNeg - Y negative coordinate erroryErrorsPos - Y positive coordinate errorinitalSize - 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 DoubleErrorDataSet(String name, int initalSize)
DoubleErrorDataSet.name - name of this DataSet.initalSize - initial capacity of buffer (N.B. size=0)IllegalArgumentException - if name is nullpublic DoubleErrorDataSet add(double x, double y)
x - horizontal coordinate of the new data pointy - vertical coordinate of the new data pointpublic DoubleErrorDataSet add(double x, double y, double yErrorNeg, double yErrorPos)
x - the new x coordinatey - the new y coordinateyErrorNeg - the +dy erroryErrorPos - the -dy errorpublic DoubleErrorDataSet add(double x, double y, double yErrorNeg, double yErrorPos, String label)
x - the new x coordinatey - the new y coordinateyErrorNeg - the +dy erroryErrorPos - the -dy errorlabel - the data labelpublic DoubleErrorDataSet add(double[] xValuesNew, double[] yValuesNew, double[] yErrorsNegNew, double[] yErrorsPosNew)
xValuesNew - X coordinatesyValuesNew - Y coordinatesyErrorsNegNew - the +dy errorsyErrorsPosNew - the -dy errorspublic DoubleErrorDataSet 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 DoubleErrorDataSet 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 DoubleErrorDataSet add(int index, double x, double y, double yErrorNeg, double yErrorPos)
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 pointyErrorNeg - the +dy erroryErrorPos - the -dy errorpublic DoubleErrorDataSet add(int index, double x, double y, double yErrorNeg, double yErrorPos, 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 pointyErrorNeg - the +dy erroryErrorPos - the -dy errorlabel - data point label (see CategoryAxis)public DoubleErrorDataSet add(int index, double[] x, double[] y, double[] yErrorNeg, double[] yErrorPos)
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 pointyErrorNeg - the +dy erroryErrorPos - the -dy errorpublic DoubleErrorDataSet clearData()
public final double get(int dimIndex,
int index)
DataSetpublic int getCapacity()
public int getDataCount(int dimIndex)
DataSetgetDataCount in interface DataSetdimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')public double getErrorNegative(int dimIndex,
int index)
DataSetErrorindex. Please note
that errors are assumed to be always positive!getErrorNegative in interface DataSetErrordimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')index - of negative 'dimIndex' error to be returned.public double getErrorPositive(int dimIndex,
int index)
DataSetErrorindex. Please note
that errors are assumed to be always positive!getErrorPositive in interface DataSetErrordimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')index - of positive 'dimIndex' error to be returned.public double[] getErrorsNegative(int dimIndex)
DataSetErrorgetErrorsNegative in interface DataSetErrordimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')public double[] getErrorsPositive(int dimIndex)
DataSetErrorgetErrorsPositive in interface DataSetErrordimIndex - the dimension index (ie. '0' equals 'X', '1' equals 'Y')public final double[] getValues(int dimIndex)
public double getX(int index)
DataSet2Dpublic double[] getXValues()
getXValues in interface DataSet2Dpublic double getY(int index)
DataSet2Dpublic double[] getYValues()
getYValues in interface DataSet2Dpublic DoubleErrorDataSet increaseCapacity(int amount)
amount - storage capacity increasepublic DoubleErrorDataSet remove(int index)
EditableDataSetremove in interface EditableDataSetindex - data point which should be removedpublic DoubleErrorDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic DoubleErrorDataSet resize(int size)
size - the actually used array lengthspublic DoubleErrorDataSet set(DataSet other)
other - the other data setpublic DoubleErrorDataSet set(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesyErrorsNeg - the +dy errorsyErrorsPos - the -dy errorspublic DoubleErrorDataSet set(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, boolean copy)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesyErrorsNeg - the +dy errorsyErrorsPos - the -dy errorscopy - true: makes an internal copy, false: use the pointer as is (saves memory allocation)public DoubleErrorDataSet set(double[] xValues, double[] yValues, double[] yErrorsNeg, double[] yErrorsPos, int nSamples, boolean copy)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesyErrorsNeg - the +dy errorsyErrorsPos - the -dy errorsnSamples - number of samples to be copiedcopy - true: makes an internal copy, false: use the pointer as is (saves memory allocation)public DoubleErrorDataSet 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 DoubleErrorDataSet 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 DoubleErrorDataSet set(int index, double x, double y, double yErrorNeg, double yErrorPos)
index - the index of the data pointx - new horizontal coordinatey - new vertical coordinateyErrorNeg - new vertical negative error of y (can be asymmetric)yErrorPos - new vertical positive error of y (can be asymmetric)public DoubleErrorDataSet set(int index, double[] x, double[] y, double[] yErrorNeg, double[] yErrorPos)
public DoubleErrorDataSet trim()
ArrayList.trimToSize()Copyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.