Package de.gsi.dataset.spi
Class AveragingDataSet
- java.lang.Object
-
- de.gsi.dataset.spi.AbstractStylable<D>
-
- de.gsi.dataset.spi.AbstractDataSet<AveragingDataSet>
-
- de.gsi.dataset.spi.AveragingDataSet
-
- All Implemented Interfaces:
DataSet,DataSet2D,DataSetMetaData,EventSource,java.io.Serializable
public class AveragingDataSet extends AbstractDataSet<AveragingDataSet> implements DataSet2D
TODO: Change to ErrorDataSet and calculate standard deviation.- Author:
- braeun
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface de.gsi.dataset.DataSetMetaData
TAG_GAIN_RANGE, TAG_OVERSHOOT, TAG_UNDERSHOOT
-
-
Constructor Summary
Constructors Constructor Description AveragingDataSet(java.lang.String name)AveragingDataSet(java.lang.String name, int fuzzyCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(DataSet2D ds)voidclear()clear all datadoubleget(int dimIndex, int index)Gets the x value of the data point with the index iintgetAverageCount()intgetAverageSize()intgetDataCount()Get the number of data points in the data set.intgetFuzzyCount()Gets the fuzzy count.java.lang.StringgetStyle(int index)A string representation of the CSS style associated with this specificDataSetdata point.intgetXIndex(double x)Gets the index of the data point closest to the given x coordinate.double[]getYValues()voidsetAverageSize(int avgCount)voidsetFuzzyCount(int fuzzyCount)Sets the fuzzy count.-
Methods inherited from class de.gsi.dataset.spi.AbstractDataSet
addDataLabel, addDataStyle, autoNotification, binarySearch, clearMetaInfo, equalDataLabels, equalEditConstraints, equalErrorValues, equalMetaData, equals, equals, equalValues, fireInvalidated, getAxisDescriptions, getDataLabel, getDataLabelMap, getDataStyleMap, getDimension, getEditConstraints, getErrorList, getIndex, getInfoList, getMetaInfo, getName, getThis, getWarningList, hashCode, lock, minNeigbourSearchX, recomputeLimits, removeDataLabel, removeStyle, setEditConstraints, setName, toString, updateEventListener
-
Methods inherited from class de.gsi.dataset.spi.AbstractStylable
getStyle, setStyle
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.gsi.dataset.DataSet
getAxisDescription, getAxisDescriptions, getDataLabel, getIndex, getName, getStyle, getValues, lock, recomputeLimits, setStyle
-
Methods inherited from interface de.gsi.dataset.DataSet2D
getDataCount, getDimension, getValue, getValue, getX, getXValues, getY, getYIndex
-
Methods inherited from interface de.gsi.dataset.event.EventSource
addListener, autoNotification, invokeListener, invokeListener, invokeListener, isAutoNotification, removeListener, updateEventListener
-
-
-
-
Method Detail
-
add
public void add(DataSet2D ds)
- Parameters:
ds- new DataSet to be added to average
-
clear
public void clear()
clear all data
-
getAverageCount
public int getAverageCount()
- Returns:
- number of data sets that have been averaged
-
getAverageSize
public int getAverageSize()
- Returns:
- number of data sets that are supposed to be averaged
-
getDataCount
public int getDataCount()
Description copied from interface:DataSet2DGet the number of data points in the data set.- Specified by:
getDataCountin interfaceDataSet- Specified by:
getDataCountin interfaceDataSet2D- Returns:
- the number of data points
-
getFuzzyCount
public int getFuzzyCount()
Gets the fuzzy count.- Returns:
- fuzzy count
-
getStyle
public java.lang.String getStyle(int index)
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<AveragingDataSet>- Parameters:
index- the index of the specific data point- Returns:
- user-specific data set style description (ie. may be set by user)
-
get
public final double get(int dimIndex, int index)Description copied from interface:DataSetGets the x value of the data point with the index i
-
getXIndex
public int getXIndex(double x)
Description copied from interface:DataSet2DGets 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.
-
getYValues
public double[] getYValues()
- Specified by:
getYValuesin interfaceDataSet2D- Returns:
- the x value array
-
setAverageSize
public void setAverageSize(int avgCount)
- Parameters:
avgCount- number of data sets that are supposed to be averaged
-
setFuzzyCount
public void setFuzzyCount(int fuzzyCount)
Sets the fuzzy count. The fuzzy count allows for a mismatch in the data count of the datasets added to the average. Datasets will be added if the size difference is less or equal to the fuzzy count. In case of a mismatch in size, the longer dataset will be truncated to the shorter one.- Parameters:
fuzzyCount- the fuzzy count
-
-