public class DoubleErrorDataSet extends AbstractErrorDataSet<DoubleErrorDataSet> implements DataSetError, EditableDataSet
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 errorsDataSetError.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 |
dataLabels, dataStyles, editConstraints, errorList, infoList, lock, metaInfoMap, name, updateListeners, warningList, xRange, yRangeTAG_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[] 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
|
int |
getCapacity() |
int |
getDataCount()
Get the number of data points in the data set
|
double |
getX(int index)
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[] |
getXValues() |
double |
getY(int index)
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. |
double[] |
getYErrorsNegative()
Returns the negative error along the Y axis for all available data
points.
|
double[] |
getYErrorsPositive()
Returns the positive error along the y axis for all available data
points.
|
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(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.
|
computeLimits, fireInvalidated, getErrorType, getThis, lock, setErrorType, unlockaddDataLabel, addDataStyle, binarySearchX, binarySearchY, clearMetaInfo, getDataCount, getDataLabel, getDataLabelMap, getDataStyleMap, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getStyle, getUndefValue, getWarningList, getXIndex, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, minNeigbourSearchX, removeDataLabel, removeStyle, setAutoNotifaction, setEditConstraints, setName, toString, updateEventListenergetStyle, setStyleclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetErrorType, getXErrorNegative, getXErrorPositive, getXErrorsNegative, getXErrorsPositive, getYErrorNegative, getYErrorPositivegetEditConstraints, setEditConstraints, setNamegetDataCount, getDataLabel, getName, getStyle, getStyle, getUndefValue, getValue, getXIndex, getXMax, getXMin, getYIndex, getYMax, getYMin, isAutoNotification, lock, setAutoNotifaction, setStyle, unlockaddListener, invokeListener, invokeListener, 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(String name)
DoubleErrorDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic 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(DataSet another)
DoubleErrorDataSet as copy of
another (deep-copy).another - name of this DataSet.public 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 double[] getXValues()
getXValues in interface DataSetpublic double[] getYValues()
getYValues in interface DataSetpublic double[] getYErrorsPositive()
DataSetErrorgetYErrorsPositive in interface DataSetErrorpublic double[] getYErrorsNegative()
DataSetErrorgetYErrorsNegative in interface DataSetErrorpublic int getDataCount()
DataSetgetDataCount in interface DataSetpublic DoubleErrorDataSet clearData()
public int getCapacity()
public DoubleErrorDataSet increaseCapacity(int amount)
amount - storage capacity increasepublic DoubleErrorDataSet resize(int size)
size - the actually used array lengthspublic DoubleErrorDataSet trim()
ArrayList.trimToSize()public double getX(int index)
DataSetpublic double getY(int index)
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.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.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.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.public 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 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 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 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 set(int index, double x, double y)
set in interface EditableDataSetindex - 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 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)
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(DataSet other)
other - the other data setCopyright © 2019 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.