public class FloatDataSet extends AbstractDataSet<FloatDataSet> 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 equivalent implementation with asymmetric errors in Y,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected it.unimi.dsi.fastutil.floats.FloatArrayList |
xValues |
protected it.unimi.dsi.fastutil.floats.FloatArrayList |
yValues |
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT| Constructor and Description |
|---|
FloatDataSet(DataSet2D another)
Creates a new instance of
FloatDataSet as copy of another (deep-copy). |
FloatDataSet(String name)
Creates a new instance of
FloatDataSet. |
FloatDataSet(String name,
float[] xValues,
float[] yValues,
int initalSize,
boolean deepCopy)
Creates a new instance of
FloatDataSet. |
FloatDataSet(String name,
int initalSize)
Creates a new instance of
FloatDataSet. |
| Modifier and Type | Method and Description |
|---|---|
FloatDataSet |
add(float[] xValuesNew,
float[] yValuesNew)
Initialises the data set with specified data.
|
FloatDataSet |
add(float x,
float y)
Add point to the end of the data set
|
FloatDataSet |
add(float x,
float y,
String label)
Add point to the DoublePoints object
|
FloatDataSet |
add(int index,
double... newValue)
add point to the data set
|
FloatDataSet |
add(int index,
double x,
double y)
add point to the data set
|
FloatDataSet |
add(int index,
float[] x,
float[] y)
add point to the data set
|
FloatDataSet |
add(int index,
float x,
float y,
String label)
add point to the data set
|
FloatDataSet |
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(int dimIndex)
Get the number of data points in the data set for a specific dimension.
|
float[] |
getXFloatValues() |
double[] |
getXValues() |
float[] |
getYFloatValues() |
double[] |
getYValues() |
FloatDataSet |
increaseCapacity(int amount) |
EditableDataSet |
remove(int index)
remove point from data set
|
FloatDataSet |
remove(int fromIndex,
int toIndex)
removes sub-range of data points
|
FloatDataSet |
resize(int size)
ensures minimum size, enlarges if necessary
|
FloatDataSet |
set(DataSet2D other)
clear old data and overwrite with data from 'other' data set (deep copy)
|
FloatDataSet |
set(float[] xValues,
float[] yValues)
Initialises the data set with specified data.
|
FloatDataSet |
set(float[] xValues,
float[] yValues,
boolean copy)
Initialises the data set with specified data.
|
FloatDataSet |
set(float[] xValues,
float[] yValues,
int nSamples,
boolean copy)
Initialises the data set with specified data.
|
FloatDataSet |
set(int index,
double... newValue)
replaces point coordinate of existing data point
|
FloatDataSet |
set(int index,
double[] x,
double[] y) |
FloatDataSet |
set(int index,
double x,
double y) |
static double[] |
toDoubles(float[] input) |
static float[] |
toFloats(double[] input) |
FloatDataSet |
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, setNamegetDimension, getValue, getValue, getX, getXIndex, getY, getYIndexgetAxisDescription, getAxisDescriptions, getDataCount, getDataLabel, getIndex, getName, getStyle, getStyle, getValues, lock, recomputeLimits, setStyleaddListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListenerprotected it.unimi.dsi.fastutil.floats.FloatArrayList xValues
protected it.unimi.dsi.fastutil.floats.FloatArrayList yValues
public FloatDataSet(DataSet2D another)
FloatDataSet as copy of another (deep-copy).another - name of this DataSet.public FloatDataSet(String name)
FloatDataSet.name - name of this DataSet.IllegalArgumentException - if name is nullpublic FloatDataSet(String name, float[] xValues, float[] yValues, int initalSize, boolean deepCopy)
Creates a new instance of FloatDataSet.
name - name of this data set.xValues - X coordinatesyValues - Y coordinatesinitalSize - initial buffer sizedeepCopy - if true, the input array is copiedIllegalArgumentException - if any of parameters is null or if arrays with coordinates have
different lengthspublic FloatDataSet(String name, int initalSize)
FloatDataSet.name - name of this DataSet.initalSize - initial buffer sizeIllegalArgumentException - if name is nullpublic FloatDataSet add(float x, float y)
x - indexy - indexpublic FloatDataSet add(float x, float y, String label)
x - indexy - indexlabel - the data labelpublic FloatDataSet add(float[] xValuesNew, float[] yValuesNew)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValuesNew - X coordinatesyValuesNew - Y coordinatespublic FloatDataSet 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 FloatDataSet 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 FloatDataSet add(int index, float x, float 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 FloatDataSet add(int index, float[] x, float[] 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 FloatDataSet clearData()
public 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 float[] getXFloatValues()
public double[] getXValues()
getXValues in interface DataSet2Dpublic float[] getYFloatValues()
public double[] getYValues()
getYValues in interface DataSet2Dpublic FloatDataSet increaseCapacity(int amount)
amount - storage capacity increasepublic EditableDataSet remove(int index)
remove in interface EditableDataSetindex - data point which should be removedpublic FloatDataSet remove(int fromIndex, int toIndex)
fromIndex - start indextoIndex - stop indexpublic FloatDataSet resize(int size)
size - the actually used array lengthspublic FloatDataSet set(DataSet2D other)
other - the source data setpublic FloatDataSet set(float[] xValues, float[] yValues)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatespublic FloatDataSet set(float[] xValues, float[] 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 FloatDataSet set(float[] xValues, float[] yValues, int nSamples, boolean copy)
Initialises the data set with specified data.
Note: The method copies values from specified double arrays.xValues - X coordinatesyValues - Y coordinatesnSamples - number of samples to be copiedcopy - true: makes an internal copy, false: use the pointer as is (saves memory allocationpublic FloatDataSet 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 FloatDataSet set(int index, double x, double y)
public FloatDataSet set(int index, double[] x, double[] y)
public FloatDataSet trim()
ArrayList.trimToSize()public static double[] toDoubles(float[] input)
public static float[] toFloats(double[] input)
Copyright © 2020 GSI Helmholtzzentrum für Schwerionenforschung GmbH. All rights reserved.