Package de.gsi.dataset.spi
Class FragmentedDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<FragmentedDataSet>
-
- de.gsi.dataset.spi.FragmentedDataSet
-
- All Implemented Interfaces:
DataSet,DataSetMetaData,EventSource
- Direct Known Subclasses:
RollingDataSet
public class FragmentedDataSet extends AbstractDataSet<FragmentedDataSet>
- Author:
- braeun
-
-
Field Summary
Fields Modifier and Type Field Description protected intdataCountprotected java.util.ArrayList<DataSet>list-
Fields inherited from class de.gsi.dataset.spi.AbstractDataSet
dataLabels, dataStyles, editConstraints, lock, metaInfoMap, name, updateListeners, xRange, yRange
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description FragmentedDataSet(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidadd(double[] xValues, double[] yValues)adds new custom x and y array values (internally generates a new DataSet)voidadd(DataSet set)voidclear()clears all sub-dataset referencesintgetDataCount()Get the number of data points in the data setintgetDataCount(double xmin, double xmax)Gets the number of data points in the range xmin to xmax.intgetDatasetCount()java.lang.StringgetStyle(int i)A string representation of the CSS style associated with this specificDataSetdata point.doublegetX(int i)Gets the x value of the data point with the index iintgetXIndex(double x)Gets the index of the data point closest to the given x coordinate.double[]getXValues()doublegetY(int i)Gets the y value of the data point with the index idouble[]getYValues()AbstractDataSet<?>shallowCopy()Deprecated.java.lang.StringtoString()-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, binarySearchX, binarySearchY, computeLimits, fireInvalidated, getDataLabel, getDefaultDataLabel, getEditConstraints, getErrorList, getInfoList, getMetaInfo, getName, getThis, getUndefValue, getWarningList, getXMax, getXMin, getXRange, getYIndex, getYMax, getYMin, getYRange, isAutoNotification, lock, minNeigbourSearchX, removeDataLabel, removeStyle, setAutoNotifaction, setEditConstraints, setName, unlock, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, invokeListener, invokeListener, removeListener
-
-
-
-
Field Detail
-
dataCount
protected int dataCount
-
list
protected final java.util.ArrayList<DataSet> list
-
-
Method Detail
-
shallowCopy
@Deprecated public AbstractDataSet<?> shallowCopy()
Deprecated.Returns a copy of the dataset. However, in contrast to a deep copy only the references to the contained dataset are copied.- Returns:
- copy of the dataset
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAbstractDataSet<FragmentedDataSet>
-
clear
public void clear()
clears all sub-dataset references
-
add
public void add(double[] xValues, double[] yValues)adds new custom x and y array values (internally generates a new DataSet)- Parameters:
xValues- new X coordinatesyValues- new Y coordinates
-
add
public void add(DataSet set)
- Parameters:
set- new data set to be added to list
-
getDatasetCount
public int getDatasetCount()
- Returns:
- number of sub-datasets
-
getYValues
public double[] getYValues()
- Returns:
- the y value array
-
getXValues
public double[] getXValues()
- Returns:
- the x value array
-
getDataCount
public int getDataCount()
Description copied from interface:DataSetGet the number of data points in the data set- Returns:
- the number of data points
-
getDataCount
public int getDataCount(double xmin, double xmax)Description copied from class:AbstractDataSetGets the number of data points in the range xmin to xmax.- Specified by:
getDataCountin interfaceDataSet- Overrides:
getDataCountin classAbstractDataSet<FragmentedDataSet>- Parameters:
xmin- the lower end of the rangexmax- the upper end of the range- Returns:
- the number of data points
-
getX
public double getX(int i)
Description copied from interface:DataSetGets the x value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the x value
-
getY
public double getY(int i)
Description copied from interface:DataSetGets the y value of the data point with the index i- Parameters:
i- the index of the data point- Returns:
- the y value
-
getStyle
public java.lang.String getStyle(int i)
Description copied from class:AbstractDataSetA string representation of the CSS style associated with this specificDataSetdata point. @see #getStyle()- Specified by:
getStylein interfaceDataSet- Overrides:
getStylein classAbstractDataSet<FragmentedDataSet>- Parameters:
i- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
getXIndex
public int getXIndex(double x)
Description copied from class:AbstractDataSetGets the index of the data point closest to the given x coordinate. The index returned may be less then zero or larger the the number of data points in the data set, if the x coordinate lies outside the range of the data set.- Specified by:
getXIndexin interfaceDataSet- Overrides:
getXIndexin classAbstractDataSet<FragmentedDataSet>- Parameters:
x- the x position of the data point- Returns:
- the index of the data point
-
-